Tag Archives: override retention policy with keep

Override the OBSOLETE with KEEP Clause in RMAN backup

RMAN-06516: time specified in KEEP UNTIL clause must be after today

Suppose you have configure the retention policy for the backup is 1 days then the backup is deleted after one with delete noprompt obsolete commands after 1 days.
If you want to override the policy you need to mention in backup command with keep clause as:

KEEP UNTIL TIME 'SYSDATE+10' -- for 10 days
KEEP FOREVER -- For forever time limit

Example:
Suppose you are using these followings commands as database backup and archive log back in one command. And retention is 1 days.
And you want to keep archive log backup more number of days like 5 days then you mention archive backup with KEEP clause to keep more than database backup.

---Keep archive log backup upto 5 days

crosscheck backup;
crosscheck archivelog all;
Backup database;
Backup keep until time ‘sysdate+5’ archivelog all;
backup current controlfile;
delete noprompt obsolete;
delete archivelog until time ‘sysdate-5’;

Change this KEEP option after backup as follows:

change backup tag full_archive_backup01 keep until time 'sysdate+182';

change backup tag full_archive_backup01 nokeep;

Error
RMAN-06516: time specified in KEEP UNTIL clause must be after today

Cause:
Following Error occurred when you mention sysdate – 5 in command when you execute.

Solution:
It explain keep expire data above the today date means sysdate+5 otherwise use change command for nokeep backup option if you donot need backup.