Sample RECOVER control statements
Use the sample control statements as models for developing your own RECOVER control statements.
Example 1: Recovering a table space
The following control statement specifies that the RECOVER utility is to recover table space DSN8D10A.DSN8S10D to the current point in time.
RECOVER TABLESPACE DSN8D10A.DSN8S10D
Example 2: Recovering a table space partition
The following control statement specifies that the RECOVER utility is to recover the second partition of table space DSN8D10A.DSN8S10D. The partition number is indicated by the DSNUM option.
RECOVER TABLESPACE DSN8D10A.DSN8S10D DSNUM 2
Example 3: Recovering a table space partition to the last image copy that was taken
The following control statement specifies that the RECOVER utility is to recover the first partition of table space DSN8D81A.DSN8S81D to the last image copy that was taken. If the last image copy that was taken is a full image copy, this full image copy is restored. If the last image copy that was taken is an incremental image copy, the most recent full image copy, along with any incremental image copies, are restored.
RECOVER TABLESPACE DSN8D81A.DSN8S81D DSNUM 1 TOLASTCOPY
Example 4: Recovering table spaces to a point in time
The following control statement specifies that the RECOVER utility is to recover the second partition of table space DSN8D10A.DSN8S10E and all of table space DSN8D10A.DSN8S10D to the indicated quiesce point (LRSN X'00000551BE7D'). The quiesce point is indicated by the TOLOGPOINT option. The value for this option can be either an LRSN or an RBA.
RECOVER TABLESPACE DSN8D10A.DSN8S10E DSNUM 2
TABLESPACE DSN8D10A.DSN8S10D
TOLOGPOINT X'00000551BE7D'
Example 5: Recovering an index to the last full image copy that was taken without deleting and redefining the data sets
The following control statement specifies that the RECOVER utility is to recover index ADMF001.IADH082P to the last full image copy. The REUSE option specifies that DB2® is to logically reset and reuse DB2-managed data sets without deleting and redefining them.
RECOVER INDEX ADMF001.IADH082P REUSE TOLASTFULLCOPY
Example 6: Recovering from concurrent copies
The RECOVER utility control statement specifies that the utility is to recover all of the objects that are included in the RCVR4_LIST. This list is defined by the preceding LISTDEF utility control statement. Because the most recent primary copy for all of these objects is a concurrent copy, CURRENTCOPYONLY option in the RECOVER statement improves the performance of restoring these concurrent copies. The LOCALSITE option indicates that RECOVER is to use image copies at the local site.
//STEP1 EXEC DSNUPROC,UID='JUOLU210.RCVR4',
// UTPROC='',
// SYSTEM='SSTR'
//UTPRINT DD SYSOUT=*
//SYSUT1 DD DSN=JUOLU210.RCVR4.STEP1.SYSUT1,
// DISP=(MOD,DELETE,CATLG),
// UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SORTOUT DD DSN=JUOLU210.RCVR4.STEP1.SORTOUT,
// DISP=(MOD,DELETE,CATLG),
// UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SYSIN DD *
LISTDEF RCVR4_LIST
INCLUDE TABLESPACES TABLESPACE DBOL1002.TSOL1002
INCLUDE TABLESPACES TABLESPACE DBOL1003.TPOL1003 PARTLEVEL 3
INCLUDE TABLESPACES TABLESPACE DBOL1003.TPOL1003 PARTLEVEL 6
INCLUDE TABLESPACES TABLESPACE DBOL1003.TPOL1004 PARTLEVEL 5
INCLUDE TABLESPACES TABLESPACE DBOL1003.TPOL1004 PARTLEVEL 9
INCLUDE INDEXSPACES INDEXSPACE DBOL1003.IPOL1051 PARTLEVEL 22
INCLUDE INDEXSPACES INDEXSPACE DBOL1003.IPOL1061 PARTLEVEL 10
INCLUDE INDEXSPACES INDEXSPACE DBOL1003.IXOL1062
RECOVER LIST RCVR4_LIST
LOCALSITE
CURRENTCOPYONLY
/*
Example 7: Recovering a list of objects on different tape devices in parallel
The control statement specifies that the RECOVER utility is to recover the list of table spaces. Full image copies and incremental image copies of the eight table spaces are stacked on four different tape volumes. The utility sorts the list of objects and, if possible, recovers two objects at a time in parallel. This number of objects is specified by the PARALLEL option. The TAPEUNITS option specifies that up to four tape drives are to be dynamically allocated.
//RECOVER EXEC DSNUPROC,SYSTEM='DSN'
//SYSIN DD *
RECOVER PARALLEL(2) TAPEUNITS(4)
TABLESPACE DB1.TS8
TABLESPACE DB1.TS7
TABLESPACE DB1.TS6
TABLESPACE DB1.TS5
TABLESPACE DB1.TS4
TABLESPACE DB1.TS3
TABLESPACE DB1.TS2
TABLESPACE DB1.TS1
Example 8: Recovering a list of objects to a point in time
The following RECOVER control statement specifies that the RECOVER utility is to recover the specified list of objects to a common point in time (LRSN X'00000551BE7D'). The LISTDEF control statement defines which objects are to be included in the list. These objects are logically consistent after successful completion of this RECOVER job. The PARALLEL option indicates that RECOVER is to restore four objects at a time in parallel. If any of the image copies are on tape (either stacked or not stacked), RECOVER determines the number of tape drives to use to optimize the process. Any uncommitted work for all of the objects at the specified RBA are backed out by the recover operation to a point in time with consistency.
LISTDEF RCVRLIST INCLUDE TABLESPACE DSN8D81A.DSN8S81D
INCLUDE INDEX DSN8810.XDEPT1
INCLUDE INDEX DSN8810.XDEPT2
INCLUDE INDEX DSN8810.XDEPT3
INCLUDE TABLESPACE DSN8D81A.DSN8S81E
INCLUDE INDEX DSN8810.XEMP1
INCLUDE INDEX DSN8810.XEMP2
RECOVER LIST RCVRLIST TOLOGPOINT X'00000551BE7D' PARALLEL(4)
Example 9: Recovering an image copy
The following control statement specifies that RECOVER is to search for an image copy with an RBA or LRSN value earlier than the specified X'00000551BE7D' value to use in the RESTORE phase. Only specified dumps of the database copy pool are used for the restore of the data sets.
RECOVER LIST RCVRLIST RESTOREBEFORE X'00000551BE7D' PARALLEL(4)
FROMDUMP DUMPCLASS(dcname)
Example 10: Recovering clone table data
The following control statement specifies that the RECOVER utility is to recover only clone table data in DBA90601.TLX9061A and recover the data to the last image copy that was taken. The REUSE option specifies that RECOVER is to logically reset and reuse DB2-managed data sets without deleting and redefining them.
RECOVER TABLESPACE DBA90601.TLX9061A REUSE TOLASTCOPY
CLONE