Replicating IBM Db2 data
You can replicate data from IBM Db2 to other databases with Data Replication.
To set up replication for Db2, first configure your Db2 instance, and then add a connection to it in a project.
You can use IBM Db2 with the Data Replication service starting with the 5.1.0 release.
Supported versions
IBM Db2 version 11.5.x for Linux, UNIX, and Windows platforms
Restrictions
-
You can replicate only some IBM Db2 data types. For more information, see Supported IBM Db2 data types.
-
You can only replicate from IBM Db2 UTF8 instances.
-
IBM Db2 can only be used as a source data store for Data Replication.
Configuring IBM Db2 as a source
To configure Db2 as a source:
-
Data Replication replicates from Db2 row-organized tables only. Verify that the tables you intend to replicate from are row-organized and not column-organized. In this example, the 'R' in column TABLEORG indicates that table SALES_ROW is row-organized and can be replicated.
SELECT tabname, tableorg FROM SYSCAT.TABLES WHERE tabname like 'SALES%' TABNAME TABLEORG ------------------------------- -------- SALES_COL C SALES_ROW R 2 record(s) selected.
-
Configure database logging parameters. Enable log retention for each database that you intend to use for replication. If you want to replicate table structure changes, enable DDL statement logging as well.
CALL SYSPROC.ADMIN_CMD ('UPDATE DATABASE CONFIGURATION USING LOG_DDL_STMTS YES')
-
Complete the following requirements:
-
Set table DATA CAPTURE CHANGES to YES. In order for Data Replication to replicate schemas and tables, the tables need to have DATA CAPTURE CHANGES set to YES. You can enable this manually for each table you wish to replicate, if the Db2 user account you specify in your connection has both SYSADM and DBADM authorities.
Example:
ALTER TABLE "BANKING"."CREDIT_SCORE" DATA CAPTURE CHANGES;
-
Data Replication requires that the table must have a column designated as the primary key.
Example:
ALTER TABLE "BANKING"."CREDIT_SCORE" ADD PRIMARY KEY ("ID") ENFORCED;
-
Connecting to Db2 in a project
To connect to IBM Db2 in a project in Cloud Pak for Data, see IBM Db2 connection.
Next step
Parent topic: Supported Data Replication connections