DB2 Server for VSE & VM: Data Restore Guide


Examples of Reloading Tables in a VM Environment

Note:Before executing a procedure to reload tables, you must run the SQLINIT EXEC specifying DBNAME(database-name) PROTOCOL(SQLDS) to:
  1. Establish database-name as the database into which the tables are to be reloaded.
  2. Ensure that an authorization ID can be specified on a CONNECT statement.

You must also link and access the minidisk where Data Restore is installed.

The following is an example of an EXEC to RELOAD from a BACKUP or UNLOAD file.

Figure 197. Example EXEC to Execute the RELOAD Function

/**/
'TAPE REW'
'FILEDEF ARCHIV TAP1 SL 1 (RECFM VB BLOCK 32760'
'FILEDEF LMBRWRK DISK LMBRWRK DATA A (RECFM FB BLOCK 28672 LRECL 4096'
'FILEDEF SYSPRINT DISK RELOAD SYSPRINT A'
'FILEDEF SYSIN DISK RELOAD SYSIN A'
'XEDIT RELOAD SYSIN A'
'XTS91001'

The SYSIN file must contain the following statements:

Figure 198. Sample SYSIN to Execute the RELOAD Function

CONTROL DBNAME=dbname
RELOAD CREATOR=SQLDBA TNAME=CUSTOMERS FUNCT=PURGE
RELOAD CREATOR=SQLDBA TNAME=SUPPLIERS
   FUNCT=NEW
   NEWTNAME=NEWSUPPLIERS
   DBSPACE=SAMPLE

The following is an example of an EXEC to RELOAD from the last BACKUP and generate the log recovery files.

Figure 199. Example EXEC to Reload Tables and Prepare Recovery from the Log

(1) ---> 'TAPE REW'
(2) ---> 'FILEDEF ARCHIV TAP1 SL 1 (RECFM VB BLOCK 32760'
(3) ---> 'FILEDEF LARCHIV TAP2 SL 1 (RECFM FB BLOCK 28672 LRECL 4096'
(4) ---> 'FILEDEF LMBRWRK DISK LMBRWRK DATA A (RECFM FB BLOCK 28672 LRECL 4096'
(5) ---> 'FILEDEF LMBRLG1 DISK LMBRLG1 DATA A (RECFM VB BLOCK 32760'
(5) ---> 'FILEDEF LMBRLG2 DISK LMBRLG2 DATA A (RECFM VB BLOCK 32760'
(5) ---> 'FILEDEF LMBRLG3 DISK LMBRLG3 DATA A (RECFM VB BLOCK 32760'
(6) ---> 'FILEDEF SYSPRINT DISK RELOAD SYSPRINT A'
(7) ---> 'FILEDEF SYSIN DISK RELOAD SYSIN A'
(8) ---> 'XEDIT RELOAD SYSIN A'
(9) ---> 'XTS91001'

Statement 1
Rewinds the tape.

Statement 2
Specifies the ddname ARCHIV for the BACKUP file.

Statement 3
Specifies the ddname LARCHIV for the log archive file.

Statement 4
Specifies the work file LMBRWRK which is used if the reloaded tables contain LONG columns.

Statement 5
Specifies the work files LMBRLG1, LMBRLG2, and LMBRLG3 which are used to extract all changes referenced in the log for the reloaded tables when the RECOVERY=YES parameter is specified. They will be used to execute forward log recovery.

Statement 6
Specifies the SYSPRINT which contains information about the process.

Statement 7
Specifies the SYSIN file.

Statement 8
Allows you to edit the SYSIN file is make any required changes before processing.

Statement 9
Calls the program to execute the function.

The SYSIN file must contain the following statements:

Figure 200. Example SYSIN to Reload a Table and Prepare Recovery from the Log

CONTROL DBNAME=dbname
OPTIONS RECOVERY=YES
RELOAD CREATOR=SQLDBA TNAME=CUSTOMERS
   FUNCT=REPLACE

The following is an example of an EXEC to RELOAD from a DB2 Server for VM archive.

Figure 201. Example Procedure to Execute the RELOAD Function from a DB2 Server for VM Archive

         /**/
(1) ---> 'FILEDEF LMBRLG1 DISK LMBRLG1 DATA A (RECFM VB BLOCK 32760'
         'FILEDEF LMBRLG2 DISK LMBRLG2 DATA A (RECFM VB BLOCK 32760'
         'FILEDEF LMBRLG3 DISK LMBRLG3 DATA A (RECFM VB BLOCK 32760'
(2) ---> 'FILEDEF ARIARCH TAP1 SL (RECFM FB BLOCK 28672 LRECL 4096'
(3) ---> 'FILEDEF ARCHIV DISK ARCHIV DATA  G (RECFM VB BLOCK 32760'
(4) ---> 'FILEDEF LARCHIV DISK BASE2 LOGDSK1  A1(RECFM F BLOCK 4096'
(5) ---> 'FILEDEF LMBRWRK DISK LMBRWRK DATA H (RECFM FB BLOCK 28672 LRECL 4096'
(6) ---> 'FILEDEF SYS0001 DISK SYS0001 DATA H(RECFM F BLOCK 4096'
(7) ---> 'FILEDEF HEADER  DISK HEADER  DATA H(RECFM F BLOCK 4096'
(8) ---> 'FILEDEF DIRWORK DISK DIRWORK DATA H(RECFM F BLOCK 0512'
(9) ---> 'FILEDEF SYSIN DISK RELOAD   SYSIN  A'
         'FILEDEF SYSPRINT DISK RELOAD   SYSPRINT A'
         'XEDIT RELOAD SYSIN A'
         'XTS91001'

Statement 1
Specifies the work files LMBRLG1, LMBRLG2, LMBRLG3 which are used for recovery processing.

Statement 2
Defines the virtual tape drive for DB2 Server for VM the archive file.

Statement 3
Defines a work file. This file will contain one DB2 Server for VM reloadable table.

Statement 4
Defines the database log archive file.

Statement 5
Defines the work file to process the function.

Statement 6
Defines the file which contains all the pages for dbspace SYS0001.

Statement 7
Defines the file which contains all the header pages.

Statement 8
Defines the file which contains all the directory pages.

Statement 9
Defines the SYSIN file.

The following is an example of a report generated by a RELOAD from a DB2 Server for VSE & VM archive.

Figure 202. Example Report from a RELOAD from a DB2 Server for VSE & VM Archive

(1) ---> XTS9-143 OPTIONS  ARCHTYPE=DB2
         XTS9-143 CONTROL  DBNAME=dbname READPW=RR
         XTS9-143 RELOAD  CREATOR=SQLDBA,TNAME=CUSTOMERS FUNCT=NEW
         XTS9-143  DBSPACE=SAMPLE
         XTS9-143 /*
         XTS9-196 Do you want to continue the RELOAD process ?
         XTS9-406 Enter 0(CANCEL) or 1(CONTINUE)
         XTS9-403 Reply is 1
         XTS9-100 Data Restore feature VERSION 7.1.0
(2) ---> XTS9-193 Mount first tape of database server archive
         XTS9-406 Enter 0(CANCEL) or 1(CONTINUE)
         XTS9-403 Reply is 1
(3) ---> XTS9-202 Processing database server archive (timestamp=1995-274-15-50)
         XTS9-169 Processing tables containing long columns
         XTS9-102        20 ROWS LOADED, PROCEDURE COMPLETED
         XTS9-128        20 ROWS LOADED INTO (SQLDBA.CUSTOMERS)
         XTS9-101         1 tables successfully processed
         CONNECT SQLDBA  ;
         COMMIT WORK ;
         XTS9-007 Processing successfully completed

Statement 1
Specifies that the input file is a DB2 Server for VSE & VM archive.

Statement 2
Prompts the operator to remount the first archive tape.

Statement 3
Displays the timestamp of the DB2 Server for VSE & VM archive.

Figure 203. Example of VM Procedure to Reload From a Backup File

/**/
'TAPE REW'
'FILEDEF ARCHIV TAP1 SL 1 (RECFM VB BLOCK 32760'
'FILEDEF LMBRWRK DISK LMBRWRK DATA A (RECFM FB BLOCK 28672 LRECL 4096'
'FILEDEF SYSPRINT DISK RELOAD SYSPRINT A'
'FILEDEF SYSIN DISK RELOAD SYSIN A'
'XEDIT RELOAD SYSIN A'
'XTS91001'
 
 
 SYSIN file must contain the following statements :
 
 CONTROL DBNAME=dbname
 RELOAD CREATOR=SQLDBA TNAME=CUSTOMERS FUNCT=PURGE
 RELOAD CREATOR=SQLDBA TNAME=SUPPLIERS
    FUNCT=NEW
    NEWTNAME=NEWSUPPLIERS
 

Figure 204. Example of VM Procedure to Reload From an Incremental Backup

/**/
'TAPE REW'
'FILEDEF ARCHIV TAP1 SL 1 (RECFM VB BLOCK 32760'
'FILEDEF FULLARC TAP1 SL1 (RECFM VB BLOCK 32760'
'FILEDEF LMBRWRK DISK LMBRWRK DATA A (RECFM FB BLOCK 28672 LRECL 4096'
'FILEDEF SYSPRINT DISK RELOAD SYSPRINT A'
'FILEDEF SYSIN DISK RELOAD SYSIN A'
'XEDIT RELOAD SYSIN A'
'XTS91001'
 
SYSIN file must contain the following statements :
 
OPTIONS WRKSIZE=4096 DEVICE2=TAPE
CONTROL DBNAME=dbname
RELOAD CREATOR=SQLDBA TNAME=CUSTOMERS FUNCT=PURGE
RELOAD CREATOR=SQLDBA TNAME=SUPPLIERS
   FUNCT=NEW
   NEWTNAME=NEWSUPPLIERS
   DBSPACE=SAMPLE
 


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]