Post on 08-Apr-2018
8/7/2019 Db2 Recovery
1/12
RECOVERYRECOVERY
Online DB2 Utilities
Author : Debaranjan Sahoo
Reference : IBM utility reference/Admin Guide
8/7/2019 Db2 Recovery
2/12
W hat requires recovery ?
DB2 DataDB2 CatalogDB2 DirectoryDB2 Objects
8/7/2019 Db2 Recovery
3/12
W hat DB2 objects can be recovered ?
Table spaces Index spaces Indexes Partitions of a Table space Individual Dataset Pages within an error range Individual Pages
8/7/2019 Db2 Recovery
4/12
Triggers for a recovery ?
Application Failure
Hardware Failures z/OS Failures Space Failures
8/7/2019 Db2 Recovery
5/12
POINT OF DATA RECOVERY
Point of data recovery could be determined usingQUIESCE utility
QUIESCE TABLESPACE DBNAME1.TSNAME1DBNAME2.TSNAME2
Drains all the table spaces one by one and establishes a point of consistency
QUIESCE TABLESPACESET
TABLESPACE db1.ts1TABLESPACE db2.ts2
8/7/2019 Db2 Recovery
6/12
Planning for recovery
Report RECOVERY utility
Recovery history from SYSIBM.SYSCOPYLog ranges from SYSIBM.SYSLGRNXVOL-SER numbers of archive logs and BSDSVOL-SER numbers of image copy dataset
8/7/2019 Db2 Recovery
7/12
Authorizations for recovery
RECOVERDB privilege on the databaseDBADM or DBCTRL authority on the databaseSYSCTRL or SYSADM authorityInstallation SYSOPR on DSNDB01 or DSNDB06
8/7/2019 Db2 Recovery
8/12
Execution phases of Recovery
8/7/2019 Db2 Recovery
9/12
RECOVERY options
TOCOPYTOLASTCOPY
TOLASTFULLCOPYTORBATOLOGPOINT
POINT IN TIME RECOVERY
8/7/2019 Db2 Recovery
10/12
Datasets used by RECOVER
SYSIN : Input dataset that contains the utility controlstatement
SYSPRINT : Output dataset for messages
8/7/2019 Db2 Recovery
11/12
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
8/7/2019 Db2 Recovery
12/12
Hands-On exercises
1. Using RC/Migrator migrate 5 table space fromDatabase MFD1 to a local database
2. Take full image copy of a table space3. Now recover using simple recover or last copy
4. Take Full copy of all the table spaces. Now runQUIESCE . Delete the data from all the tablespaces. Recover using START_RBA. Alsorecover the indexes on the table spaces.