Daisy chain synchronization

The Data Gate service synchronizes Db2 for z/OS data to Db2 instance on CP4D. Once your data is synchronized on CP4D, you have the option to extend the synchronization to subsequent targets using various synchronization tools.

Achieving Daisy Chain Synchronization

To successfully implement a daisy chain synchronization, it is essential to be aware of the following two points:

  1. Determine the underlayer target tables name.
    The Data Gate service only exposes alias names for the target tables, rather than the actual table names. For your daisy chain synchronization, you need to identify the names of the underlying target tables. You can use the db2look utility. This tool allows you to generate a dump of all the Data Definition Language (DDL) for the target database, making it easier to locate and identify the specific table names that interest you.
    oc exec -it ${DB2U_POD_NAME} -n ${PROJECT_CPD_INST_OPERANDS} su - db2inst1
    db2look -d bludb -e > db2look.out
    Open the db2look.out file in a text editor and search for the string of your source table name (for example, TABLE1). The Data Gate service adds the TABLE ID and TABLE VERSION strings to the names of all the tables that it creates. You might, for example, find the following strings:
    "DWAXXX"."TABLE1-ID_182-V1"
    "DWAXXX"."TABLE1-ID_182-V2"
    XXX stands for the location name of the table. ID-182 is the table ID. V1 and V2 are the table version. This is the name of the table in the catalog of the target database. Choose the newest version of the table.
  2. Add DATA CAPTURE CHANGES property for target table. It is required for supporting synchronization.
    1. Identify the Data Gate instance identifier, and assign the value to the variable DG_INSTANCE_ID by issuing the oc get dginstance command. For example:
      oc get dginstance -n ${PROJECT_CPD_INST_OPERANDS}
      NAME VERSION BUILD STATUS RECONCILED AGE
      dg1699914520773847 5.0.0 5.0.0.82 Completed 5.0.0 6h58m
      In this example, the instance ID is dg1699914520773847. Set the variable DG_INSTANCE_ID to this instance ID.
    2. Identify the Data Gate instance pod, and assign the value to the variable DG_POD by issuing the following oc get pod command:
      DG_POD=$(oc get pod -n ${PROJECT_CPD_INST_OPERANDS} -l icpdsupport/app=dg-instance-server,\
      icpdsupport/serviceInstanceId=`echo ${DG_INSTANCE_ID} | sed 's/^dg//'` -o jsonpath='{.items[0].metadata.name}')
    3. Go to the data-gate-server container of the Data Gate pod on CP4D:
      oc exec -it ${DG_POD} -n ${PROJECT_CPD_INST_OPERANDS} -c data-gate-server -- bash
    4. Edit the file /head/clone-api/application-prod.properties in the data-gate-server container. Search ENABLE_DATA_CAPTURE_CHANGES_ON_BACKEND_TABLES and change it to ENABLE_DATA_CAPTURE_CHANGES_ON_BACKEND_TABLES = true. Once this change is made, any newly loaded table is defined with the DATA CAPTURE CHANGES property. You can verify it by checking column DATACAPTURECHAR in syscat.tables of the Db2 instance.