Setting the REPL_SITE_ID for schemas and tables with row modification tracking

Before you restore schemas that contain replicated tables with row modification tracking, you must set a unique replication identifier at the source and target databases.

Before you begin

  • Follow these steps on both the source and target systems.
  • Run all commands while logged in as dsadm.

About this task

Row modification tracking allows you to continue DML operations on Db2® column-organized tables during a schema backup and restore operation. To enable the feature, Db2 adds three system-maintained hidden columns to the tables, including SYSROWID, a unique row identifier for the table.

Replication must ensure that the identity sequence of the SYSROWID column on each replication site generates completely different and non-overlapping values so that SYSROWID column values remain unique even after switching workloads from one site to another. To enable this, you set a unique REPL_SITE_ID at the source and target databases.

Procedure

  1. Disconnect all applications from the database and verify that all connections are closed:
    db2 terminate
    db2 force application all
    db2 list applications
  2. Deactivate the database:
    db2 deactivate db BLUDB
  3. Set a unique replication site ID between 1 and 63.
    db2 update db cfg for BLUDB using REPL_SITE_ID n IMMEDIATE
    Note: You must ensure that the value of REPL_SITE_ID is unique across all replication sites to avoid duplicate values in the SYSROWID column that could lead to unresolvable conflicts and errors. For partitioned databases, all partitions in the same database should share the same REPL_SITE_ID.
  4. Activate the database:
    db2 activate db BLUDB
  5. Check that REPL_SITE_ID is set for all database partitions:
    db2 connect to bludb;
    db2 "SELECT NAME, SUBSTR(VALUE,1,5) AS VALUE, DBPARTITIONNUM FROM SYSIBMADM.DBCFG WHERE NAME = 'repl_site_id' ORDER BY DBPARTITIONNUM WITH UR"
    
  6. Enable Wolverine:
    wvcli system enable -m enable
  7. Outside of Docker, start the web console:
    ap apps enable WebConsole

    Check the status of the console:

    ap apps
  8. The web console server and the replication web server are started by Wolverine automatically. Check the status of these servers:
    /opt/ibm/dsserver/bin/status.sh
    /opt/ibm/bludr/scripts/bin/bludr-status.sh

    If you are running Db2 and do not have access to Wolverine, the web console server, or the Replication REST server, run the following commands:

    /opt/ibm/dsserver/bin/start.sh
    /opt/ibm/bludr/scripts/bin/bludr-start.sh