Connect CDC (SQData) Change Data Capture was designed to be both robust and forgiving in that it takes a simple and conservative approach when deciding where in the log to start capturing data when first started or upon being restarted following either a scheduled interruption of the capture or an unplanned disruption in a production environment.
The first time the Db2/z Capture agent is started, it uses the "current" Db2 LSN/RBA as starting point by Default. Capture can also be started for the first time at a specific point-in-time by explicitly specifying the start LSN. The current LSN can be determined using the Db2 -DISPLAY LOG command and then selecting a starting LSN based on the Begin Time of a logged transaction. Other transactions that started before that LSN but not already been committed or that are subsequently rolled back are considered in-flight units-of-work and will be ignored along with all other transactions that committed prior to that LSN.
The starting Db2 LSN/RBA is specified in the capture .cab configuration file. The LSN can be set at a global capture agent level; all tables in the configuration file and all Subscribing Engines/Targets or for individual Subscriptions/Targets. An LSN of 0 indicates that capture should start from the current point in the Db2 log. This is used when starting the capture agent for the first time or in a test environment when skipping ahead to the current log point may be desirable.
When adding a new table to an existing configuration file, that table will be captured from the current point in the Db2 log. In a test environment resetting the Global LSN to 0 will start the entire capture from the current point in time.
- Clear LSN for cab file in-case the logs has been rotated.
- Enter d next to the CAB File(s) you want to delete.
- Restart Agent in-case of IPL or crash or stuck.
Example
//*----------------------------------------
//*- SET LSN AT GLOBAL LEVEL
//*----------------------------------------
//SETLSN EXEC PGM=SQDCONF
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SQDPARMS DD *
modify /home/sqdata/db2cdc/db2cdc.cab --lsn=0
//*