Please enable JavaScript to view this site.

There may be times when a point-in-time recovery is required, where changes made from a few hours or even days earlier must be or recaptured, perhaps because an Engine script was modified. The appropriate LSN <value> can be determined by using the Db2 -DISPLAY LOG command and/or running the Db2 Log Print Utility DSNJ004.  The first thing to determine is if there is more than one Engine subscribed to the capture and if there is, whether recaptured changes should be published to one all of the subscribed Engines.

1.Regardless of how many Engines are subscribed or will require re-capture and re-publishing, the Global LSN must be set to the the appropriate value as follows:

//*----------------------------------------

//*-  SET LSN AT GLOBAL LEVEL

//*----------------------------------------

//SETLSN   EXEC PGM=SQDCONF

//SYSPRINT DD SYSOUT=*

//SYSOUT   DD SYSOUT=*

//SQDPARMS DD *

modify /home/sqdata/db2cdc1/DB2CDC1.cab --lsn=<lsn_value>

 

2.Next, you must determine if changes will be re-captured and  re-published to one or more subscribing Engines. For every Engine that requires re-capture a separate SQDCONF Job step must be run that specifies both the target datastore (subscribing Engine) and the remine LSN.

//*----------------------------------------

//*-  SET LSN FOR ONE SPECIFIC Engine

//*----------------------------------------

//SETLSN1   EXEC PGM=SQDCONF

//SYSPRINT DD SYSOUT=*

//SYSOUT   DD SYSOUT=*

//SQDPARMS DD *

modify /home/sqdata/db2cdc1/DB2CDC1.cab --target=cdc:////DB2TODB2 --lsn=<lsn_value>

 

3.Finally, after the modifications are complete the Capture must be restarted with an additional --safe-restart=<value> parameter specifying the starting LSN for the re-capture.

//SQDDB2C  EXEC PGM=SQDDB2C,REGION=0M

//*SQDDB2C  EXEC PGM=XQDDB2C,REGION=0M

//SQDPUBL  DD DSN=SQDATA.NACL.PUBLIC,DISP=SHR

//SQDPKEY  DD DSN=SQDATA.NACL.PRIVATE,DISP=SHR

//SYSPRINT DD SYSOUT=*

//SYSOUT   DD SYSOUT=*

//CEEDUMP  DD SYSOUT=*

//SQDLOG   DD SYSOUT=*

//*SQDLOG8  DD DUMMY

//*SQDPARMS DD DISP=SHR,DSN=SQDATA.V400.PARMLIB(DB2CDC)

//SQDPARMS DD *

--apply --start --safe-restart=<lsn_value>

/home/sqdata/db2cdc1/DB2CDC1.cab

//*

 

Note: If  the capture was running while the SQDCONF modify Job steps were executed, the Capture must be Stopped before the changes can be Applied to the Capture configuration file.