Sample RESTORE SYSTEM control statements

Use the sample control statements as models for developing your own RESTORE SYSTEM utility control statements.

The RESTORE SYSTEM utility uses data that is copied by the BACKUP SYSTEM utility.

Example 1: Recovering a backup system

The following control statement specifies that RESTORE SYSTEM is to recover a Db2 subsystem or a data sharing group to a previous point in time by restoring volume copies and applying any outstanding log changes.

//STEP1    EXEC DSNUPROC,TIME=1440,    
//         UTPROC='',                  
//         SYSTEM='DSN'               
//SYSIN    DD *                        
  RESTORE SYSTEM                       
/*                                                                                           

Example 2: Recovering a backup system after the database volumes have already been restored

The LOGONLY keyword in the following control statement indicates that RESTORE SYSTEM is to apply any outstanding log changes to the database. The utility is not to restore the volume copies. In this example, the database volumes were restored outside of Db2. RESTORE SYSTEM applies log changes; it never restores the log copy pool.

//STEP1    EXEC DSNUPROC,TIME=1440,                                          
//         UTPROC='',                                                        
//         SYSTEM='DSN'                                                     
//SYSIN    DD *                                                              
  RESTORE SYSTEM LOGONLY                                                     
/*                                                                           

Example 3: Recovering a dump on tape of the database copy pool

The following control statement specifies that the RESTORE SYSTEM utility is to consider for restore only dumps on tape of the database copy pool. During the restore, the utility dynamically allocates a maximum of four tape units.

//SYSOPRB JOB (ACCOUNT),'NAME',CLASS=K                      
//UTIL EXEC DSNUPROC,SYSTEM=V91A,UID='TEMB',UTPROC=''       
//*                                                         
//*                                                         
//DSNUPROC.SYSUT1 DD DSN=SYSOPR.SYSUT1,                     
//     DISP=(MOD,DELETE,CATLG),                             
//     SPACE=(16384,(20,20),,,ROUND),                       
//     UNIT=SYSDA                                           
//DSNUPROC.SYSIN    DD  *                                   
    RESTORE SYSTEM FROMDUMP TAPEUNITS 4    							
//	                                                         
             

Example 4: Recovering a backup system after the database volumes have already been restored and VCAT aliases renamed

The LOGONLY keyword in the following control statement indicates that RESTORE SYSTEM is to apply any outstanding log changes to the database. The utility is not to restore the volume copies. In this example, the database volumes were restored outside of Db2. RESTORE SYSTEM applies log changes; it never restores the log copy pool. The SWITCH VCAT SYSVALUEDDN(SYSVALUE) keywords indicate that the SYSVALUE DD name data set contains a list of pairs of integrated catalog facility (ICF) (VCAT) aliases. The first (VCAT) alias is the name when the backup was created and the second (VCAT) alias is the name after any renaming is complete. The (VCAT) alias DSNC000 is specified as both the first and second alias since it was not renamed and might be encountered in the log.

//STEP1    EXEC DSNUPROC,TIME=1440,                                          
//         UTPROC='',                                                        
//         SYSTEM='DSN'                                                     
//SYSIN    DD *                                                              
  RESTORE SYSTEM LOGONLY SWITCH VCAT SYSVALUEDDN(SYSVALUE)                   
/* 
//SYSVALUE  DD *                                                              
VCAT1,VCAT2  
VCAT5,Z1234567
DSNC000,DSNC000 
/*                                                                           
Start of change

Example 5: Recovering from an alternate copy pool

The following control statement specifies that RESTORE SYSTEM is to consider for restore only those system-level backups that are associated with the specified alternate copy pool.

 RESTORE SYSTEM ALTERNATE_CP(ALTERNATE1)                         
             

When you run this utility, the output messages show that the utility uses the copy pool name DSN$ALTERNATE1$DB:

DSNU050I    220 10:09:53.61 DSNUGUTC -  RESTORE SYSTEM ALTERNATE_CP(ALTERNATE1)
DSNU1606I   220 10:09:53.61 DSNUVBRD - RESTORE SYSTEM UTILITY STARTING,  
                       COPYPOOL = DSN$ALTERNATE1$DB                      
                       TOKEN = X'C4C2F2C1CD931537CA6A07E40000A5140114'.  

RESTORE SYSTEM generated this name based on the ALTERNATE_CP value in the utility statement and the DB2® convention for copy pool names.

Related information:
End of change
Start of change

Example 6: Recovering from an older system-level backup

The following control statement specifies that RESTORE SYSTEM is to consider for restore only those system-level backups that were taken before the specified RBA or LRSN. In this case, RESTORE SYSTEM uses the most recent system-level backup before X'000000000000A5D6498A'.

RESTORE SYSTEM RESTOREBEFORE X'000000000000A5D6498A'                     
             
End of change