The following built in parameters are available in DB2 to manage the retention policy and automatically delete the backup images:
|
Parameter |
Description |
Example |
|---|---|---|
|
NUM_DB_BACKUPS |
Use this parameter to specify the number of database backups to retain. |
(NUM_DB_BACKUPS) = <n> - DB2 will retain up to <n> number of database backups in the media. |
|
REC_HIS_RETENTN |
Use this parameter to specify the recovery history retention in days. |
(REC_HIS_RETENTN) = <n> - The database history will be removed after <n> number of days. |
|
AUTO_DEL_REC_OBJ |
Use this parameter to set the automatic deletion of recovered objects. (ON/OFF) |
(AUTO_DEL_REC_OBJ) = ON |
When you set the AUTO_DEL_REC_OBJ parameter to ON, the backup and log information in db2 history file will be pruned/deleted. However, Commvault will not delete the backup images. Set sCvDB2EnablePruning key to y in the registry under <Commvault Instance>/Db2Agent to enable the DB2 triggered pruning for Commvault's backup images.
-
Example:
Instance001/Db2Agent -
Run the following command on a DB2 Client to prune the backup image:
$ db2 prune history <timestamp> with force option and deleteExample
[db2inst1@host1 ~]$ db2 prune history 20130801192856 with force option and delete DB20000I The PRUNE command completed successfully.
Note: If you use the sCvDB2EnablePruning additional setting, then it will supersede the data retention policy on storage policy level.