20 August,2013 by Jack Vamvas
How can I manage a DB2 database backup retention policy if the database is configured to use TSM . I understand I can manage the old backups through a script , but I’d prefer if DB2 managed the process?
DB2 manages backup files and the retention policy using built-in database configuration parameters. Since DB2 9.5 , three parameters are available to manage the retention policy and automatic deletion of backup images.
Number of database backups to retain (NUM_DB_BACKUPS) = 10 Recovery history retention (days) (REC_HIS_RETENTN) = 10 Auto deletion of recovery objects (AUTO_DEL_REC_OBJ) = ON
This example removes database history entries after 10 days. As AUTO_DEL_REC_OBJ is turned ON, DB2 will remove the files – on the filesystem or TSM. This process also manages the archive logfiles.
To clarify: the combination of NUM_DB_BACKUPS and REC_HIS_RETENTN will automate the recovery history file pruning and AUTO_DEL_REC_OBJ will trigger the deletion of the physical log files and backup images associated with the pruned entries.
To change the values of these settings, an example:
db2 update db cfg for using AUTO_DEL_REC_OBJ ON
You may encounter a problem of backup images existing on the TSM server timestamped from before the history file reference.
In those situations you’ll need to issue a db2adutl delete . The command will delete the older backup images on the TSM server, currently not synched up with the history file
db2adutl delete FULL older than db .