You are on page 1of 12

RECOVERY

Online DB2 Utilities

Author : Debaranjan Sahoo

Reference : IBM utility reference/Admin Guide


What requires recovery ?

•DB2 Data
•DB2 Catalog
•DB2 Directory
•DB2 Objects
What DB2 objects can be recovered ?
• Table spaces
• Index spaces
• Indexes
• Partitions of a Table space
• Individual Dataset
• Pages within an error range
• Individual Pages
Triggers for a recovery ?

• Application Failure
• Hardware Failures
• z/OS Failures
• Space Failures
POINT OF DATA RECOVERY
Point of data recovery could be determined using
QUIESCE utility

QUIESCE TABLESPACE DBNAME1.TSNAME1


DBNAME2.TSNAME2

QUIESCE TABLESPACESET
TABLESPACE db1.ts1
TABLESPACE db2.ts2
Drains all the table spaces one by one and establishes a
point of consistency
Planning for recovery
Report RECOVERY utility

•Recovery history from SYSIBM.SYSCOPY


•Log ranges from SYSIBM.SYSLGRNX
•VOL-SER numbers of archive logs and BSDS
•VOL-SER numbers of image copy dataset
Authorizations for recovery

•RECOVERDB privilege on the database


•DBADM or DBCTRL authority on the database
•SYSCTRL or SYSADM authority
•Installation SYSOPR on DSNDB01 or DSNDB06
Execution phases of Recovery
RECOVERY options
•TOCOPY
•TOLASTCOPY
•TOLASTFULLCOPY
•TORBA
•TOLOGPOINT

POINT IN TIME RECOVERY


Datasets used by RECOVER

SYSIN : Input dataset that contains the utility control


statement

SYSPRINT : Output dataset for messages


Recovery : Examples
RECOVER TABLESPACE DBNAME1.SPACENAM1
RECOVER TABLESPACE DSN8D81A.DSN8S81D DSNUM 2
RECOVER TABLESPACE DSN8D81A.DSN8S81D DSNUM 1 TOLASTCOPY

RECOVER TABLESPACE DSN8D81A.DSN8S81E DSNUM 2


TABLESPACE DSN8D81A.DSN8S81D
TOLOGPOINT X’00000551BE7D’

RECOVER INDEX ADMF001.IADH082P REUSE TOLASTFULLCOPY


Hands-On exercises

1. Using RC/Migrator migrate 5 table space from


Database MFD1 to a local database
2. Take full image copy of a table space
3. Now recover using simple recover or last copy
4. Take Full copy of all the table spaces. Now run
QUIESCE . Delete the data from all the table
spaces. Recover using START_RBA. Also
recover the indexes on the table spaces.

You might also like