DB2 Version 9.7 for Linux, UNIX, and Windows

Automating database recovery object management

You can use the auto_del_rec_obj database configuration parameter and automated recovery history file pruning to configure the DB2 database manager to automatically delete unneeded recovery objects after every full database backup operation.

About this task

After every successful full (non-incremental) database backup operation or full (non-incremental) table space backup operation, the database manager prunes the recovery history file according to the settings of the num_db_backup and rec_his_retentn configuration parameters, as follows:
  • when there are more database backup entries in the recovery history file than the value of the num_db_backups configuration parameter,
  • those entries do not have their status set to do_not_delete, and
  • those entries from the recovery history file are older than the value specified by the rec_his_retentn configuration parameter,
    Note: If the rec_his_retentn configuration parameter is set to 0, then the automatic pruning is based on the setting for the num_db_backups parameter.

If you set the auto_del_rec_obj database configuration parameter to ON, then the database manager does the following in addition to pruning entries from the recovery history file:

If there are no full database backup images available for consideration in the current recovery history (perhaps none were ever taken), then images older than the range of time specified by rec_his_retentn are deleted.

If the database manager is unable to delete a file because the file is no longer at the location listed in the recovery history file, then the database manager will prune the history entry.

If the database manager is unable to delete a file because of a communication error between the database manager and the storage manager or device, then the database manager will not prune the history file entry. When the error is resolved, the file can be deleted during the next automated prune.

Procedure

To configure the database manager to automatically delete unneeded recovery objects:

  1. Set the auto_del_rec_obj database configuration parameter to ON
  2. Set the rec_his_retentn and num_db_backups configuration parameters to values appropriate for your recovery strategy.

Example

Consider the following scenario which shows how the settings for automatic deletion interact. User1's backup plan specifies a weekly full database backup, with two incremental backups during the week. User1 has the following configuration:
  • auto_del_rec_obj=ON
  • rec_his_retentn=0
  • num_db_backups=3
In this scenario, User1 keeps three weeks of history, three full backups, and all of the incremental backups and logs in between those backups. With this configuration, if User1 changes to daily backups, User1 keeps three days of history, three full backups, and all of the incremental backups and logs in between those backups.
If User1 changes to the following configuration:
  • auto_del_rec_obj=ON
  • rec_his_retentn=15
  • num_db_backups=3
User1 still keeps three weeks of history, three full backups, and all of the incremental backups and logs in between those backups. However, if User1 changes to daily backups, User1 keeps 15 days of history, 15 full backups, and all of the incremental backups and logs in between those backups.