Installing a Db2 instance for Db2 Data Gate on Cloud Pak for Data

You must install, provision, and configure a Db2 or Db2 Warehouse instance on Cloud Pak for Data for each Db2 Data Gate instance.

About this task

A Db2 Data Gate instance requires either a Db2 or Db2 Warehouse instance depending on the type of target database you select when creating a Db2 Data Gate instance.

In either case, the following requirements and recommendations should be followed during Db2 installation and configuration to ensure correct operation and optimal performance of Db2 Data Gate:

Procedure

  1. Recommended: For the best Db2 Data Gate performance, create a Db2 or Db2 Warehouse service instance on a dedicated node with its own dedicated storage and set the storage volume type to hostPath.
    The hostPath storage volume type offers a lower I/O latency. Always aim for an extremely low synchronization latency and a high load throughput.

    Note that each database instance needs a different dedicated hostPath location on the host machine.

  2. Recommended: For the best Db2 Data Gate performance, after the Db2 or Db2 Warehouse instance is created, consider to increase the total size of the Db2 or Db2 Warehouse log file. Otherwise, the loading of tables might fail because the log file is too small.
    • For test and development systems, consider to increase the total size to about 3 GB by setting the value of the logfilsiz parameter to 50000 and the value of the logprimary parameter to 15.
    • For production systems, your Db2 administrator should adjust the settings based on the system capacity.
    • To avoid losing your logfilsiz and logprimary settings after an upgrade, change the configuration of the target database as follows:
      1. As the user db2inst1, access the container of the Db2 or Db2 Warehouse target database and run a command to update the configuration. To this end, replace ${DB2U_POD_NAME} with the name of the server pod name and ${PROJECT_CPD_INST_OPERANDS} with your project name in the following sample command. Also replace xxx with appropriate values. Then run the command.
        oc exec -it ${DB2U_POD_NAME} -n ${PROJECT_CPD_INST_OPERANDS} su - db2inst1
        db2 update db cfg for bludb using logfilsiz xxx logprimary xxx
      2. Update the database configuration parameters of your cluster:
        1. Determine the Db2ucluster CR name of your target database instance and edit it. To this end, replace ${PROJECT_CPD_INST_OPERANDS} with your project name in the following sample command. Then run the command.
          oc get db2ucluster -n ${PROJECT_CPD_INST_OPERANDS}
          DB2UCLUSTER_ID=<db2ucluster_cr_name>
          oc edit db2ucluster ${DB2UCLUSTER_ID} -n ${PROJECT_CPD_INST_OPERANDS}
        2. The database configuration (YAML file) is now in edit mode. Database configuration parameters are added under spec.environment.databases.dbConfig. Navigate to this section and add or change the logfilsiz and logprimary values as shown in the following example:
          spec:
            environment:
              databases:
                name: BLUDB
                dbConfig:
                  logprimary: "10"
                  logfilsiz: "250000"
        3. Save and exit the YAML file. Then exit the container.
  3. Recommended: To further optimize the performance after the creation of the Db2 instance, consider increasing the values of the locklist and maxlock parameters. This is to avoid that too many row locks are replaced with a lock of the entire table while tables are being synchronized (a process called lock escalation).
    • For test and development systems, keep the default value Automatic.
    • For production systems, change the value of the locklist parameter to 500000 and the value of the maxlocks parameter to 13.