Recovering a DB2 system to a given point in time using the RESTORE SYSTEM utility
Use the RESTORE SYSTEM utility to recover your DB2® system to a given point in time. Recovering to a given point in time minimizes the amount of data that you lose when you recover.
Before you begin
The RESTORE SYSTEM utility uses system-level backups that contain only DB2 objects to restore your DB2 system to a given point in time. The following prerequisites apply:
- Before you can use the RESTORE SYSTEM utility, you must use the BACKUP SYSTEM utility to create system-level backups. Choose either DATA ONLY or FULL, depending on your recovery needs. Choose FULL if you want to backup both your DB2 data and your DB2 logs.
- When a system-level backup on tape is the input for
the RESTORE SYSTEM utility, the user who submits the job must have
the following two RACF® authorities:
- Operations authority, as in ATTRIBUTES=OPERATIONS
- DASDVOL authority, which you can set in the following way:
You can restrict this authority to specific user IDs.SETROPTS GENERIC(DASDVOL) REDEFINE DASDVOL * UACC(ALTER) SETROPTS CLASSACT(DASDVOL) SETROPTS GENERIC(DASDVOL) REFRESH
Procedure
To recover data to a given point in time:
- Issue the STOP DB2 command to stop your DB2 system. If your system is a data sharing group, stop all members of the group.
- If the backup is a full system backup, you might need to restore the log copy pool outside of DB2 by using DFSMShsm FRRECOV COPYPOOL (cpname) GENERATION (gen). For data-only system backups, skip this step.
- Create a conditional restart record, where the SYSPITR option specifies the given point in time that you want to recover to. Run DSNJU003 (the change log inventory utility) with the CRESTART SYSPITR and SYSPITRT options, and specify the log truncation point that corresponds to the point in time to which you want to recover the system. For data sharing systems, run DSNJU003 on all active members of the data-sharing group, and specify the same LRSN truncation point for each member. If the point in time that you specify for recovery is prior to the oldest system backup, you must manually restore the volume backup from tape.
- For data sharing systems, delete all CF structures that the data sharing group owns.
- Restore any logs on tape to disk.
- Issue the START DB2 command to restart your DB2 system. For data sharing systems, start all active members.
- Run the RESTORE SYSTEM utility. If you manually restored the backup, use the LOGONLY option of RESTORE SYSTEM to apply the current logs.
- Stop and restart DB2 again to remove ACCESS(MAINT) status.
Results
After the RESTORE SYSTEM utility completes successfully, your DB2 system has been recovered to the given point in time with consistency.