This database configuration parameter specifies the number of days that historical information on backups are retained.
This parameter is configurable online. Default value: 366
$ db2 get db cfg |grep REC_HIS
Recovery history retention (days) (REC_HIS_RETENTN) = 366
Various permutations & Combinations:
(1) rec_his_retentn = -1, auto_del_rec_obj = OFF
Number of entries for full database backup and associated tablespace backups depend upon NUM_DB_BACKUPS. Other entries such as Logs, etc need to be pruned/removed manually.
(2) rec_his_retentn = -1, auto_del_rec_obj = ON
Recovery history file is not automatically pruned and no recovery objects are deleted.
(3) rec_his_retentn = 0, auto_del_rec_obj = OFF
All entries in the recovery history file except the last full backup are pruned.
(4) rec_his_retentn = 0, auto_del_rec_obj = ON
automated history file pruning and recovery object deletion are carried out based on the timestamp of the backup selected by the num_db_backups database configuration parameter.
No matter how small the retention period, the most recent full database backup plus its restore set is always kept, unless you use the PRUNE command with the FORCE option.
If both the num_db_backups and rec_his_retentn configuration parameters are set, backups are not removed unless both the num_db_backups and rec_his_retentn conditions are satisfied.