I need to keep 3 sets of database backups with RMAN retention but I need to keep 15 days worth of archive logs in the directory. Right now rman deletes the archives older than 3 days with the following command
configure retention policy to redundancy 3;
delete noprompt expired archivelog all;
delete noprompt expired backup;
delete noprompt obsolete;
which is the best way to tweak this in order to keep 15 days archive logs and need only 3 days data (file) backup?
Thanks in advance
what is the actual difference of "recovery window" and retention.?
Different ways to deal with obsolescence of backups. Basically redundancy N = "I want to keep N level 0 backups" , recovery window of N = "I want to keep files needed to recover until N days". It's well documented there :
Notice the page also describes how to set a specific deletion policy for archivelog files.
I have a different question regarding backup set and piece if you don't mind. I tried to clean up a calalog by running rman delete obsolete, delete expired, delete obsolete orphen, etc.... i saw most records in rc_backup_set and rc_backup_piece were cleaned as i intended. However, there are still some old records in rc_backup_piece and rc_backup_set. There were last year archived log backups and should have been deleted. Do you know why they still remain in the catalog and how to remove them? Thanks
If think , it is strange to have datafile backups for 3 days and archivelogs for 15 days backward.
Because if you don't have previous backups - archivelogs are useless.
Delete archivelogs is simple:
DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-15';
if you have correct RETENTION POLICY set up for datafile backups , delete noprompt obsolete - deletes useless backups of datafiles and archivelogs at the same time.