Uninstalling Data Gate

An instance administrator can uninstall Data Gate.

Who needs to complete this task?

Instance administrator To uninstall Data Gate, you must be an instance administrator. An instance administrator has permission to manage software in the following projects:

The operators project for the instance

The operators for this instance of IBM® Software Hub are installed in the operators project. In the uninstall commands, the ${PROJECT_CPD_INST_OPERATORS} environment variable refers to the operators project.

The operands project for the instance

The IBM Software Hub control plane and the services for this instance of IBM Software Hub are installed in the operands project. In the uninstall commands, the ${PROJECT_CPD_INST_OPERANDS} environment variable refers to the operands project.

When do you need to complete this task?

Complete this task if you want to remove Data Gate from an instance of IBM Software Hub.

Repeat as needed If you are responsible for multiple instances of IBM Software Hub, you can repeat this task to remove other instances of Data Gate on the cluster.

Information you need to complete this task

Review the following information before you uninstall Data Gate:

Environment variables
The commands in this task use environment variables so that you can run the commands exactly as written.
  • If you don't have the script that defines the environment variables, see Setting up installation environment variables.
  • To use the environment variables from the script, you must source the environment variables before you run the commands in this task. For example, run:
    source ./cpd_vars.sh

Procedure

Complete the following tasks to uninstall Data Gate:

  1. Deleting the service instance
  2. Uninstalling the service

Deleting the service instance

Before you uninstall Data Gate, you must delete the Data Gate service instance. This ensures that the instance releases any resources that it reserved.

Who needs to complete this task?
A user with the Manage service instances permission must complete this task.
When do you need to complete this task?
Complete this task before you uninstall Data Gate.

From the Cloud Pak for Data web client:

  1. Log in to the web client as a user with sufficient permissions to complete the task.
  2. From the menu, select Services > Instances.
  3. Filter the list to show the dg type.
  4. Delete the dg instance.

Uninstalling the service

To uninstall Data Gate:

  1. Log the cpd-cli in to the Red Hat® OpenShift® Container Platform cluster:
    ${CPDM_OC_LOGIN}
    Remember: CPDM_OC_LOGIN is an alias for the cpd-cli manage login-to-ocp command.
  2. Delete the custom resource for Data Gate.
    cpd-cli manage delete-cr \
    --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
    --components=datagate \
    --include_dependency=true
    Wait for the cpd-cli to return the following message before you proceed to the next step:
    [SUCCESS]... The delete-cr command ran successfully
  3. Delete the OLM objects for Data Gate:
    cpd-cli manage delete-olm-artifacts \
    --cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} \
    --components=datagate
    Wait for the cpd-cli to return the following message:
    [SUCCESS]... The delete-olm-artifacts command ran successfully

What to do next

You might want to remove all related objects and settings from your Db2 for z/OS configuration, for example after finishing a test or a proof-of-concept.

Removing the remaining database objects

You can remove the remaining Data Gate-related database objects by running the following SQL statements. This task is optional.

Attention: Do not run the following commands if the Db2 for z/OS installation is also used by IBM Db2® Analytics Accelerator. The objects are used by both Data Gate and IBM Db2 Analytics Accelerator.
  1. Set DSNZPARM ACCEL to NO or remove it. This parameter change requires a Db2 restart, which can be postponed to the next scheduled maintenance window.
  2. For each Db2 subsystem connected to an accelerator, run -STOP ACCEL.
  3. In Db2 for z/OS, drop the DSNACCEL database, including all tables and table spaces whose names start with SYSACCEL. These objects were created by the DSNTIJAS job during the creation of the database. For more information, see Creating the Data Gate database and tables in Db2 for z/OS.
  4. Restart Db2 for z/OS right after the drop. If you omit the restart, Db2 for z/OS ends abnormally.

Cleaning up the communications database

  1. Run the following SQL query to get a list of the provisioned Data Gate instances:
    SELECT LINKNAME,IPADDR FROM SYSIBM.IPNAMES;

    Where

    IPADDR
    Is the hostname of the Data Gate instance, which was specified when the instance was provisioned.
    LINKNAME
    Is the name of the Data Gate instance in the CDB, which you want to remove.
  2. Delete entries from the CDB by running the following SQL statements for each Data Gate instance. Replace Data Gate name with the corresponding LINKNAME returned by the SQL query in step 1.
    
    DELETE FROM SYSACCEL.SYSACCELERATORS WHERE ACCELERATORNAME='Data Gate name';
    DELETE FROM SYSACCEL.SYSACCELERATEDTABLES WHERE ACCELERATORNAME='Data Gate name';
    DELETE FROM SYSIBM.LOCATIONS WHERE LINKNAME = 'Data Gate name';
    DELETE FROM SYSIBM.IPNAMES  WHERE LINKNAME = 'Data Gate name';
    DELETE FROM SYSIBM.USERNAMES  WHERE LINKNAME = 'Data Gate name';

Removing procedures and functions

Attention: Do not run the following commands if you want to remove a single Data Gate instance and keep other instances or IBM Db2 Analytics Accelerator. Bear in mind that these procedures and functions are used by all Data Gate instances and by IBM Db2 Analytics Accelerator.

Clean up the Db2 communications database (CDB) manually by following the steps here:

  1. DROP TABLE DSNAQT.ACCEL_*;
  2. DROP VIEW DSNAQT.ACCEL_NAMES;
  3. DROP SEQUENCE DSNAQT.UNLOADIDS;
  4. DROP PROCEDURE SYSPROC.ACCEL_*;
  5. DROP FUNCTION DSNAQT.ACCEL_*;
  6. FREE PACKAGE SYSACCEL.*;