Registering an existing DB2 source table for CCD (Consistent Changed Data) replication using the DB2 Replication Center:
This blog entry is from lessons learned on a recent engagement in which the client wanted to replicate several large tables from a Linux system to a Windows system for reporting. Due to disk space concerns they didn’t want the entire table replicated, only data that has changed.
This blog assumes you already have the Capture control server already configured in Replication Center and you want to enable an existing table for replication of changed data only.
NOTE: If Capture is currently running, stop Capture before adding registering source tables otherwise it won’t be recognized by the capture process. Stop both Apply and Capture if you will be adding a source table and registering it in a subscription set during the same window.
On the Capture Schemas/ASN/Registered tables folder right click to ‘Register tables’. On the Definition tab leave the ‘Stop Capture on error’ and ‘Allow full refresh of target table’ checked. Uncheck the ‘Capture changes from replica target table’ box which is used for update-anywhere configuration.
Selecting ‘Allow full refresh’ on this menu does not mean the table will be fully copied from source to target. It only allows the initial replication execution to handshake successfully between capture and apply processes.
NOTE: Selecting the check box for ‘Allow full refresh’ sets the DISABLE_REFRESH column of the IBMSNAP_REGISTER table to 0 which is necessary for the initial handshake to take place. As long as the target table is made a type of CCD (Consistent Changed Data) and Non-Complete, a full table refresh will not take place.
NOTE: A Table that has just been added has the MEMBER_STATE as ‘N’ in the SUBS_MEMBER table and Apply will attempt the handshake for this table alone if possible. After the initial run of Capture and Apply for that table’s changes, the DISABLE_REFRESH column should automatically be set back to 1.
The CD Table and CD-Table Index tabs are used for naming a Changed Data table (CD table) which stores the replicated data for this table only. You can also define the tablespace it goes in and the index name. These definitions should follow your company standards.
Restart Capture and you should see changed data copied to your CD table and made ready for the Apply process to pick it up.