Recovery history file

A recovery history file is created with each database and is automatically updated during various operations.

The following operations cause the recovery history file to be updated:
  • A database or table spaces are backed up
  • A database or table spaces are restored
  • A database or table spaces are rolled forward
  • A database is automatically rebuilt and more than one image is restored
  • A table space is created
  • A table space is altered
  • A table space is quiesced
  • A table space is renamed
  • A table space is dropped
  • A table is loaded
  • A table is dropped (when dropped table recovery is enabled and you are using recoverable logging)
  • A table is reorganized
  • On-demand log archiving is invoked
  • A new log file is written to (when using recoverable logging)
  • A log file is archived (when using recoverable logging)
  • A database is recovered
  • A failed restore database or table space operation
Figure 1. Creating and updating the recovery history file
The recovery history file is created with the database, and updated with backup and restore operations

You can use the summarized backup information in this file to recover all or part of a database to a given point in time. The information in the file includes:

  • An identification (ID) field to uniquely identify each entry
  • The part of the database that was copied and how
  • The time the copy was made
  • The location of the copy (stating both the device information and the logical way to access the copy)
  • The last time a restore operation was done
  • The time at which a table space was renamed, showing the previous and the current name of the table space
  • The status of a backup operation: active, inactive, expired, or deleted
  • The last log sequence number saved by the database backup or processed during a rollforward recovery operation.

To see the entries in the recovery history file, use the LIST HISTORY command.

Every backup operation (database, table space, or incremental) includes a copy of the recovery history file. The recovery history file is associated with the database. Dropping a database deletes the recovery history file. Restoring a database to a new location restores the recovery history file. Restoring does not overwrite the existing recovery history file unless the file that exists on disk has no entries. If that is the case, the database history is restored from the backup image.

If the current database is unusable or not available, and the associated recovery history file is damaged or deleted, an option on the RESTORE command allows only the recovery history file to be restored. The recovery history file can then be reviewed to provide information about which backup to use to restore the database.

The size of the file is controlled by the rec_his_retentn configuration parameter that specifies a retention period (in days) for the entries in the file. Even if the number for this parameter is set to zero (0), the most recent full database backup (plus its restore set) is kept. (The only way to remove this copy is to use the PRUNE HISTORY with FORCE option.) The retention period has a default value of 366 days. The period can be set to an indefinite number of days by using -1. In this case, explicit pruning of the file is required.