After a RELOAD function has been processed, the table contains rows as they appeared in the table when the BACKUP was taken. All changes executed on the table after the BACKUP function was taken can be reprocessed by Data Restore on the reloaded table.
If among the log changes on a table, a DELETE FROM TABLE command was issued in error, you may want to stop the recovery before the DELETE command is reexecuted. By specifying END=timestamp, the recovery process stops before the timestamp. If a DROP command that involves one of the reloaded tables is encountered in the log, the recovery process stops automatically for the table.
Forward log recovery can only be processed from a BACKUP archive (not an UNLOAD) and on the original database. You cannot do log recovery after reloading a table into a different database.
Figure 123. Apply Changes From the Log To the Reloaded Tables
To determine the value to specify for the END parameter, execute the LISTLOG function (for more information refer to Step 3. List the Changes Extracted from the Log Files). An example of the use of TIMESTAMP is: TIMESTAMP=1995-320-12-30-01-000000.
Notes:
To process all the SQL statements in LMBRLG1, LMBRLG2, and LMBRLG3, execute the APPLYLOG function using program XTS91001.
You must have previously run the RELOAD function, from a BACKUP, with the RECOVERY=YES parameter to reload the tables.
The following is an example of JCL (VSE) to execute the statements in the recovery files.
Figure 124. Sample JCL to Execute SQL Statements in the Recovery Files
// JOB APPLYLOG
(1) ---> // LIBDEF *,SEARCH=(PRD2.DB2vrm,PRD2.RCVvrm)
(2) ---> // DLBL LMBRWRK,,,VSAM
(3) ---> // DLBL LMBRLG1,,,VSAM
(3) ---> // DLBL LMBRLG2,,,VSAM
(3) ---> // DLBL LMBRLG3,,,VSAM
(4) ---> // EXEC XTS91001,SIZE=AUTO
(5) ---> CONTROL DBAPW=XXXXXXXX
(6) ---> APPLYLOG END=1995-260-23-59-59-000000
/*
The following is an example on an EXEC to execute the SQL statements in the recovery files.
Figure 125. Sample EXEC to Execute SQL Statements in the Recovery Files
/**/
(1) ---> 'FILEDEF SYSIN DISK LISTLOG SYSIN A'
(2) ---> 'FILEDEF SYSPRINT DISK LISTLOG SYSPRINT A'
(3) ---> 'FILEDEF LMBRWRK DISK LMBRWRK DATA A (RECFM FB BLOCK 28672 LRECL 4096'
(4) ---> 'FILEDEF LMBRLG1 DISK LMBRLG1 DATA A (RECFM VB BLOCK 32760'
(4) ---> 'FILEDEF LMBRLG2 DISK LMBRLG2 DATA A (RECFM VB BLOCK 32760'
(4) ---> 'FILEDEF LMBRLG3 DISK LMBRLG3 DATA A (RECFM VB BLOCK 32760'
(5) ---> 'XTS91001'
The SYSIN file must contain the following statements:
Figure 126. Sample SYSIN for the APPLYLOG Function
(1) ---> CONTROL DBAPW=XXXXXXXX
(2) ---> APPLYLOG END=1995-260-23-59-59-000000
Figure 127. Example of a Report from APPLYLOG Execution
XTS9-143 OPTIONS LANG=S001
XTS9-143 CONTROL DBAPW=********
XTS9-143 APPLYLOG END=1996-255-16-46-47-646175
XTS9-143 /*
XTS9-100 Data Restore feature VERSION 7.1.0
XTS9-007 Processing successfully completed