Recovery of page sets and data sets

You can recover objects in several ways, if the objects have the LOGGED attribute.

  • If you made backup copies of table spaces by using the COPY utility, the COPYTOCOPY utility, or the inline copy feature of the LOAD or REORG utility, use the RECOVER utility to recover the table spaces to the current or a previous state.
  • If you made backup copies of indexes by using the Db2 COPY utility, use the RECOVER utility to recover the indexes to the current or a previous state. Backing up indexes is optional.
  • If you made system-level backups using the BACKUP SYSTEM utility, use the RECOVER utility to recover the objects to the current or a previous state.
  • If you made backup copies using a method outside of Db2 control, such as with DSN1COPY or the DFSMSdss concurrent copy function, use the same method to restore the objects to a prior point in time. Then, if you want to restore the objects to currency, run the RECOVER utility with the LOGONLY option.

The RECOVER utility performs these actions:

  • Restores the most current backup, which can be either a full image copy, concurrent copy, or system-level backup.
  • Applies changes recorded in later incremental image copies of table spaces, if applicable, and applies later changes from the archive or active log.

RECOVER can act on:

  • A table space, or list of table spaces
  • An index, or list of indexes
  • A specific partition or data set within a table space
  • A specific partition within an index space
  • A mixed list of table spaces, indexes, partitions, and data sets
  • A single page
  • A page range within a table space that Db2 finds in error
  • The catalog and directory

Typically, RECOVER restores an object to its current state by applying all image copies or a system-level backup and log records. It can also restore the object to a prior state, which is one of the following points in time:

  • A specified point on the log (use the TOLOGPOINT or TORBA keyword)
  • A particular image copy (use the TOCOPY, TOLASTCOPY, or TOLASTFULLCOPY keywords)

You can use the RECOVER utility with the BACKOUT YES keyword to recover data to a prior state by backing out committed work from the current state of an object.

The RECOVER utility can use system-level backups for object level recovery. The RECOVER utility chooses the most recent backup of either an image copy, concurrent copy, or system-level backup to restore. The most recent backup determination is based on the point of recovery (current or prior point in time) for the table spaces or indexes (with the COPY YES attribute) being recovered.

The RECOVER utility can use image copies for the local site or the recovery site, regardless of where you invoke the utility. The RECOVER utility locates all full and incremental image copies.

The RECOVER utility first attempts to use the primary image copy data set. If an error is encountered (allocation, open, or I/O), RECOVER attempts to use the backup image copy. If Db2 encounters an error in the backup image copy or no backup image copy exists, RECOVER falls back to an earlier full copy and attempts to apply incremental copies and log records. If an earlier full copy in not available, RECOVER attempts to apply log records only.

Important: Be very careful when using disk dump and restore for recovering a data set. Disk dump and restore can make one data set inconsistent with Db2 subsystem tables in some other data set. Use disk dump and restore only to restore the entire subsystem to a previous point of consistency, and prepare that point as described in the alternative in step Preparing to recover an entire Db2 subsystem to a prior point in time using image copies or object-level backups.