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:
      SETROPTS GENERIC(DASDVOL)
      REDEFINE DASDVOL * UACC(ALTER)
      SETROPTS CLASSACT(DASDVOL)
      SETROPTS GENERIC(DASDVOL) REFRESH
      You can restrict this authority to specific user IDs.
    This RACF authority is required, because the RESTORE SYSTEM utility invokes DFSMSdss when tape is the input. However, when you restore database copy pools from a FlashCopy® on disk, the RESTORE SYSTEM utility invokes DFSMShsm, which does not require Operations or DASDVOL authority.

Procedure

To recover data to a given point in time:

  1. Issue the STOP DB2 command to stop your DB2 system. If your system is a data sharing group, stop all members of the group.
  2. 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.
  3. 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.
  4. For data sharing systems, delete all CF structures that the data sharing group owns.
  5. Restore any logs on tape to disk.
  6. Issue the START DB2 command to restart your DB2 system. For data sharing systems, start all active members.
  7. Run the RESTORE SYSTEM utility. If you manually restored the backup, use the LOGONLY option of RESTORE SYSTEM to apply the current logs.
  8. 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.