A recovery history file is created with each database and is automatically updated whenever there is a:
Figure 34. Creating and Updating the Recovery History File
You can use the summarized backup information in this file to recover all or part of the database to a given point in time. The information in the file includes:
Every backup operation (both table space and full database) includes a copy of the recovery history file. The recovery history file is linked to 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 history recovery file.
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 on which backup to use to restore the database.
The size of the file is controlled by the rec_his_retentn configuration parameter (see "Recovery History Retention Period (rec_his_retentn)") 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 with FORCE option.) The retention period has a default 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.
You can query and run commands against the recovery history file by using an API function call, the command line processor, or the Control Center. The five basic queries and commands are: OPEN, CLOSE, GET NEXT, UPDATE, and PRUNE. (For more information on the command syntax see the Command Reference. For more information on the API function call, see the API Reference. For more information on the Control Center, access the Control Center from your workstation.)
Detailed information about the history file is recorded in the SQLUHINFO structure. For more information about this structure, refer to the API Reference.
[ DB2 List of Books | Search the DB2 Books ]