The RELOAD function can reload tables from a BACKUP file. All changes executed on the tables after the BACKUP function are recorded in the log.
After a RELOAD function, if the parameter RECOVERY=YES was specified on the OPTIONS statement (for more information see OPTIONS Statement Parameters; the LMBRLG1, LMBRLG2, LMBRLG3 files contain all the SQL statements from the log that affect the table.
You can use the LISTLOG function to list the contents of these files. The APPLYLOG function must be used to apply the changes in these files. Tables reloaded from an UNLOAD file cannot have log changes applied.
Figure 118. List the Changes Extracted from the Log Input work files:
When you reload a table and request the RECOVERY process, all changes referenced in the log will be extracted. If, for example, you are recovering a table that was accidentally corrupted, and you reapply all the changes, the LUW that corrupted the table will also be reexecuted. You need to know the timestamp of that LUW so that you can reapply all changes up to but not including the LUW in error.
The timestamp is used during the APPLYLOG function (refer to Step 4. Apply LUWs Referenced in the Log to the Reloaded Tables for more information) on the END parameter to apply the log changes up to the LUW in error.
Note: | The timestamp of each LUW and SQL command has the following format: |
YYYY-DDD-HH-MM-SS-mmmmmm
Example: 1995-260-23-59-59-000000
To list the contents of LMBRLG1, LMBRLG2, and LMBRLG3, execute the LISTLOG function using the XTS91001 program.
The following is an example of JCL (VSE) to list the contents of the recovery files.
Figure 119. Example JCL to List the Contents of the Recovery Files
// JOB LISTLOG
(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) ---> LISTLOG
/*
The following is an example of an EXEC to list the contents of the recovery files.
Figure 120. Sample Procedure to List the Content of 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 121. Control Statement for LISTLOG in a VM Environment
(1) ---> CONTROL DBAPW=XXXXXXXX
(2) ---> LISTLOG
For each row in the LMBRLG1 file, two lines are displayed:
Figure 122. Example Report After LISTLOG Function Execution
(1) ---> C 00004084 1995-251-10-56-29-861568
(2) ---> INSERT INTO "SQLDBA"."CUSTOMERS" VALUES ('TEST',0,200)
(3) ---> R 00004092 1995-256-10-58-00-126994
(4) ---> DELETE FROM "SQLDBA"."CUSTOMERS" WHERE "CUST_NO"=1245