Uninstalling Db2 Data Gate
A project administrator can uninstall Db2 Data Gate.
- What permissions do you need to complete this task?
- The permissions that you need depend on which tasks you must complete:
- To uninstall Db2 Data Gate, you must be an administrator of the project where Db2 Data Gate is installed. This project is identified by the
${PROJECT_CPD_INSTANCE}
environment variable. - To uninstall the Db2 Data Gate operators, you must be an administrator of the project
where the Cloud Pak for Data operators are installed. This project
is identified by the
${PROJECT_CPD_OPS}
environment variable.
- To uninstall Db2 Data Gate, you must be an administrator of the project where Db2 Data Gate is installed. This project is identified by the
- When do you need to complete this task?
- Complete this task if you want to remove a running instance of Db2 Data Gate from your environment.
Information you need to complete this task
Review the following information before you uninstall Db2 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:
source ./cpd_vars.sh
- Installation location
- Db2 Data Gate is installed in the same project (namespace) as the Cloud Pak for Data control
plane. This project is identified by the
${PROJECT_CPD_INSTANCE}
environment variable.
Procedure
Complete the following tasks to uninstall Db2 Data Gate:
Deleting the service instance
Before you uninstall Db2 Data Gate, you must delete the Db2 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 Db2 Data Gate.
From the Cloud Pak for Data web client:
- Log in to the web client as a user with sufficient permissions to complete the task.
- From the menu, select .
- Filter the list to show the dg type.
- Delete the dg instance.
Logging in to the cluster
To run cpd-cli
manage
commands, you must log in to the cluster.
To log in to the cluster:
-
Run the
cpd-cli manage login-to-ocp
command to log in to the cluster as a user with sufficient permissions to complete this task. For example:cpd-cli manage login-to-ocp \ --username=${OCP_USERNAME} \ --password=${OCP_PASSWORD} \ --server=${OCP_URL}
Tip: Thelogin-to-ocp
command takes the same input as theoc login
command. Runoc login --help
for details.
Uninstalling the service
- Who needs to complete this task?
- You must be an administrator of the project where Db2 Data Gate is installed.
- When do you need to complete this task?
- Complete this task if you want to remove Db2 Data Gate from your deployment.
If you installed Db2 Data Gate in multiple projects, you must complete this task for each instance of Db2 Data Gate that you want to uninstall.
To uninstall the service:
- Delete the custom resource for Db2 Data Gate.
cpd-cli manage delete-cr \ --components=datagate \ --cpd_instance_ns=${PROJECT_CPD_INSTANCE}
Uninstalling the operator
- Who needs to complete this task?
- You must be an administrator with the appropriate permissions to manage OLM objects.
- When do you need to complete this task?
- Complete this task only if you want to completely remove the Db2 Data Gate software from the cluster.
To uninstall the operator and other OLM objects:
- Delete
the OLM objects for Db2 Data Gate:
cpd-cli manage delete-olm-artifacts \ --cpd_operator_ns=${PROJECT_CPD_OPS} \ --components=datagate
- If the command succeeds, it returns [SUCCESS]... The delete-olm-artifacts command ran successfully.
- If the command fails, it returns [ERROR] and includes information about the cause of the failure.
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 Db2 Data Gate-related database objects by running the following SQL statements. This task is optional.
- 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.
- For each Db2 subsystem connected to an accelerator, run
-STOP ACCEL
. - 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 Db2 Data Gate database and tables in Db2 for z/OS.
- Restart Db2 for z/OS right after the drop. If you omit the restart, Db2 for z/OS will end abnormally.
Cleaning up the communications database
- Run the following SQL query to get a list of the provisioned Db2 Data
Gate instances:
SELECT LINKNAME,IPADDR FROM SYSIBM.IPNAMES;
where
- IPADDR
- Is the host name of the Db2 Data Gate instance which was specified when the instance was provisioned.
- LINKNAME
- Is the name of the Db2 Data Gate instance in the CDB, which you want to remove.
- Delete entries from the CDB by running the following SQL statements for each Db2 Data
Gate instance. Replace
Data Gate name
with the correspondingLINKNAME
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
Clean up the Db2 communications database (CDB) manually by following the steps here:
DROP TABLE DSNAQT.ACCEL_*;
DROP VIEW DSNAQT.ACCEL_NAMES;
DROP SEQUENCE DSNAQT.UNLOADIDS;
DROP PROCEDURE SYSPROC.ACCEL_*;
DROP FUNCTION DSNAQT.ACCEL_*;
FREE PACKAGE SYSACCEL.*;