Changes to the target database

The service instance creation process makes changes to the configuration of the selected target database (Db2 or Db2 Warehouse). See what these changes are.

  1. Db2 registry variables are updated:
    Db2 Db2 Warehouse
    • DB2_WORKLOAD=ANALYTICS_ACCELERATOR
    • DB2_SELECTIVITY=ALL,AJSEL,UNIQUE_COL_FF ON
    • DB2_APPENDERS_PER_PAGE=1
    • DB2LOCK_TO_RB=STATEMENT
    • DB2MAXFSCRSEARCH=1
    • DB2_STATISTICS="USCC:0;DISCOVER:ON; CGS_SAMPLE_RATE_ADJUST:0; RAND_COLGROUPID:Y; LEN21_COLGROUPNAME:Y;AUTO_SAMPLING_IMPRV:ON"
    • DB2_WAITFORDATA_LIBNAME= /mnt/blumeta0/home/db2inst1/config_db2u/waitfordata/libs/libwaitForDataSharedLib.so
    • DB2_WORKLOAD=ANALYTICS_ACCELERATOR
    • DB2CODEPAGE=1208
    • DB2_CDE_REDUCED_LOGGING=TRANSITION_THRESHOLD:320
    • DB2_RUNTIME_DEBUG_FLAGS=SECTION_LEVEL_LOB
    • DB2_SECTION_SCRATCH_BUFFER_SIZE=512K
    • DB2LOCK_TO_RB=STATEMENT
    • DB2_SELECTIVITY=ALL,AJSEL
    • DB2COMPOPT=CDE_NEQN_ENABLE
    • DB2_ATM_CMD_LINE_ARGS="-include-manual-tables -low-priority-update-systables"
    • DB2_OBJECT_TABLE_ENTRIES=65532
    • DB2_EXT_TABLE_SETTINGS=COMM_BUFFER_SIZE:1113840
    • DB2_CDE_DICTIONARY_CACHE_CLEANUP_SCAN_LIST_INTERVAL=30
    • DB2_CDE_DICTIONARY_CACHE_CLEANUP_INTERVAL=60
    • DB2_APPENDERS_PER_PAGE=1
    • DB2_EXTENDED_OPTIMIZATION="COL_RTABLE_UD_THR 0,XGBPART ON FULL NONHDIR,ENABLE_OLAP2AGG ON,NI2NE_WITH_NULLS OUTER,COLJOIN 1,NEQN_DECORR ON"
    • DB2_REDUCED_OPTIMIZATION="COL_RTS OFF,EGAD 0"
    • DB2_CDE_DATA_SETTINGS=VECTORIZED_INSERT:YES
    • DB2_WLM_SETTINGS=
    • DB2_CDE_AUTO_REORG_RECOMPRESS=
    • DB2_CDE_COMPRESSION_SETTINGS="HISTOGRAM_MAX_VARSTRING_SZ:1000"
    • DB2_CDE_DCC=no
    • DB2_STATISTICS="USCC:0;DISCOVER:ON;CGS_SAMPLE_RATE_ADJUST: 0;RAND_COLGROUPID:Y;LEN21_COLGROUPNAME:Y; AUTO_SAMPLING_IMPRV:ON"
    • DB2_TCG_DEFAULT_OPTIONS="set percentile_cont_spill on"
    • DB2_CORRELATED_PREDICATES="CGS_CARD_BOUND ON"
    • DB2_SQB_EXTENTMOVEMENT_BUFFER_SIZE=16384
    • DB2_COL_RUNPROF_HSJOIN="DUPPAYLOADSZ_LIMIT ON"
    • DB2_ADVIS_OPTIONS="COL_PART ON"
    • DB2_WAITFORDATA_LIBNAME= /mnt/blumeta0/home/db2inst1/config_db2u/waitfordata/libs/libwaitForDataSharedLib.so
  2. For Db2 Warehouse, the following Database Manager configuration parameters are set or changed:
    • DIAGSIZE 500
    • START_STOP_TIME 5
    • MAX_QUERYDEGREE 6
  3. For the target databases, the configuration changes as follows:
    • LOGARCHMETH1 is set to OFF. This disables archive logging for a Db2 or Db2 Warehouse instance, so that the database runs in circular logging mode. This can improve the synchronization performance, but in some cases you might have to re-enable archive logging. Consider:
      • Your target database also contains tables that are not managed by Data Gate. You can only recover these by using the backup and archive logs.

        In contrast, Data Gate tables can be recovered from Db2 for z/OS by simply reloading these.

      • Other replication tools might use the target database as a source, and replicate changes to a new target as in a replication chain. Such tools require that archive logging is enabled.
      Tip: To avoid a BACKUP PENDING state of the Db2 target database after an upgrade, complete these steps before the upgrade:
      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 LOGARCHMETH1 value as shown in the following example:
        spec:
          environment:
            database:
              name: BLUDB
              dbConfig:
                LOGARCHMETH1: "OFF"
      3. Save and exit the YAML file. Then exit the container.
      4. The dbConfig changes of Db2ucluster CR will be detected, then applied automatically. You can monitor pod logs to verify the configurations are applied successfully. Run the command:
        oc logs c-${DB2UCLUSTER_ID}-db2u-0 -n ${PROJECT_CPD_INST_OPERANDS}
        The output looks like:
        {"level":"info","result":"stdout: Waiting for up to 180 sec until a change is detected in
        the relevant configmaps... change detected\n(*) Applying DB cfg settings\nParameters that require
        updating: EXTBL_LOCATION LOCKLIST LOGARCHMETH1 LOGBUFSZ LOGFILSIZ LOGPRIMARY MAXLOCKS\nParameters
        that support online updating: LOGSECOND\nDB20000I The TERMINATE command completed
        successfully.\n(*) Applying Db2 db cfg parameters for BLUDB\nupdate db cfg for BLUDB using
        AUTO_DEL_REC_OBJ ON DFT_SCHEMAS_DCC NO EXTBL_LOCATION
        /mnt/blumeta0/db2/load;/mnt/blumeta0/home;/mnt/bludata0/scratch;/mnt/external;/mnt/blumeta0/db2/backup
        EXTBL_STRICT_IO NO LOCKLIST 500000 LOGARCHMETH1 OFF LOGBUFSZ 131070 LOGFILSIZ 250000 LOGPRIMARY 10
        LOGSECOND 20 LOG_APPL_INFO NO LOG_DDL_STMTS NO MAXLOCKS 13 NUM_DB_BACKUPS 2 REC_HIS_RETENTN 7\nDB20000I
        The UPDATE DATABASE CONFIGURATION command completed successfully.\nSQL1363W One or more of the parameters
        submitted for immediate modification \nwere not changed dynamically. For these configuration parameters,
        the database \nmust be shutdown and reactivated before the configuration parameter changes
        \nbecome effective.\n\nforce application all\nDB20000I The FORCE APPLICATION command completed
        successfully.\nDB21024I This command is asynchronous and may not be effective
        immediately.\n\n\ndeactivate db BLUDB\nDB20000I The DEACTIVATE DATABASE command completed
        successfully.\n\ndeactivate db BLUDB\nSQL1495W Deactivate database is successful, however,
        there is still a \nconnection to the database.\n\nactivate db BLUDB\nDB20000I The ACTIVATE DATABASE
        command completed successfully.\n\nDatabase was activated successfully\n hostname:
        c-db2oltp-1717040404643209-db2u-0","caller":"[13]:db2.go:346:ApplyCfg()","timestamp":"2024-05-30T16:31:39Z",
        "message":"executed apply Db2 configuration cmd for setting db"}
    • Other changes are specific to the type of the target database that you use:
      Db2 Db2 Warehouse
      • PAGE_AGE_TRGT_MCR 30
      • AUTO_SAMPLING ON
      • AUTO_CG_STATS ON
      • AUTHN_CACHE_USERS 20
      • AUTHN_CACHE_DURATION 60
      • MAXLOCKS 10
      • PCKCACHESZ 65536
      • LOGARCHMETH2 OFF
      • SECTION_ACTUALS NONE
      • AUTO_MAINT ON
      • AUTO_TBL_MAINT ON
      • AUTO_REORG ON
      • AUTO_STMT_STATS ON
      • AUTO_RUNSTATS ON
      • EXTBL_LOCATION /
      • AUTO_SAMPLING ON
      • MON_DEADLOCK HIST_AND_VALUES
      • MON_LOCKTIMEOUT HIST_AND_VALUES
      • MON_LOCKWAIT NONE
      • AUTO_CG_STATS ON
      • AUTO_DEL_REC_OBJ ON
      • TRACKMOD YES
      • MON_LCK_MSG_LVL 3
      • WLM_AGENT_LOAD_TRGT 24
      • AUTO_STATS_VIEWS ON
      • DFT_EXTENT_SZ 4
      • AUTHN_CACHE_USERS 20
      • AUTHN_CACHE_DURATION 60
  4. The database instance is restarted so that the changes can take effect.
  5. A memory table function is installed by the following SQL statement:
    CALL SYSINSTALLOBJECTS('ANACC','C','','')
  6. The following tag file is added:
    /mnt/blumeta0/home/db2inst1/dg_config_done.XXX

    where XXX is the instance ID of the target database.