Pruning the recovery history file

The database manager creates entries in the recovery history file for events such as a backup operation, a restore operation, table space creation, and others. When an entry in the recovery history file is no longer relevant, because the associated recovery objects would no longer be needed to recover the database, you might want to remove, or prune, those entries from the recovery history file.

Procedure

You can prune the entries in the recovery history file using the following methods:

  • Invoke the PRUNE HISTORY command
  • Call the db2Prune API
  • Call the ADMIN_CMD procedure with the PRUNE_HISTORY parameter

What to do next

When you use one of these methods to prune the recovery history file, the database manager removes (prunes) entries from the recovery history file that are older than a timestamp you specify.

If a recovery history file entry matches the criteria you specify for pruning, but that entry would still be needed for a recovery of the database, the database manager will not prune the entry unless you use the WITH FORCE parameter or the DB2PRUNE_OPTION_FORCE flag.

If you use the AND DELETE parameter or the DB2PRUNE_OPTION_DELETE flag, then log files associated with pruned entries will be deleted as well.

If you set the AUTO_DEL_REC_OBJ database configuration parameter to ON, and you use the AND DELETE parameter or the DB2PRUNE_OPTION_DELETE flag, then log files, backup images, and load copy images associated with pruned entries will be deleted.