Avoiding table state ERROR as a result of a Db2 shutdown

After a shutdown of the target database service (Db2 or Db2 Warehouse), some of your Db2 Data Gate tables are in the ERROR state. You can avoid this by following the steps here.

About this task

If you click the Table tab on the dashboard of your Db2 Data Gate instance, you can see that some of your tables are in the ERROR state, which means that you have to reload these tables.

The shutdown of the target database service interrupts the last phase of the synchronization process (table-change-apply-process). As a consequence, affected tables are set to the ERROR state.

If you know ahead of time that your target database service will be shut down, you can avoid the error state of your Db2 Data Gate tables, and thus also avoid a reloading of these tables. Follow these steps:

Procedure

If you know ahead of time that your target database service will be shut down, you can avoid the error state of your Db2 Data Gate tables, and thus also avoid a reloading of these tables. Follow these steps:

  1. Before you stop the target database service, open the dashboard of your Db2 Data Gate instance, and stop synchronization by clicking the following switch:
    Synchronization ON/OFF toggle button on Data Gate dashboard. Current state: On

    The switch must show an operation mode of Off:

    Synchronization toggle button set to OFF

    Alternatively, you can go to the command-line of the Cloud Pak for Data control plane, and run the following commands on the data-gate-api container:

    oc exec -it ${DG_POD} -c data-gate-api -n ${PROJECT_CPD_INST_OPERANDS} -- bash
    cd /head/clone-api/scripts
    sh stop_replication.sh ${CP4D_USERNAME} ${CP4D_PASSWORD} ${IAM_Integration}

    where:

    DG_POD
    Is the pod name of the Db2 Data Gate instance
    PROJECT_CPD_INST_OPERANDS
    Is the project name of the Cloud Pak for Data control plane and services
    CP4D_USERNAME
    Is the name that you use to log in to Cloud Pak for Data and to access the Db2 Data Gate UI
    CP4D_PASSWORD
    Is the password belonging to the login user name.
    IAM_Integration
    Is a value that indicates whether Cloud Pak for Data has been integrated with the Identity Management Service. A value of true means integrated; false means not integrated.
  2. Stop the target database service (Db2 or Db2 Warehouse).
  3. Finish your maintenance work on the target database.
  4. Restart the target database service.
  5. On the dashboard of your Db2 Data Gate instance, restart synchronization by clicking the switch so that it shows On:
    Synchronization restarted by clicking the toggle button. State is ON.

    Alternatively, you can run the following commands:

    oc exec -it ${DG_POD} -c data-gate-api -n ${PROJECT_CPD_INST_OPERANDS} -- bash
    cd /head/clone-api/scripts
    sh start_replication.sh ${CP4D_USERNAME} ${CP4D_PASSWORD} ${IAM_Integration}

    For a description of the parameters, see the list in step 1.