Question: Am having
some problem with deleting old backups. We have old
backups on disk. Have kept the recovery window for 30 days.
After that when I execute
RMAN>
delete obsolete;
When I issue the RMAN delete
obsolete command it deletes only a few backup files. many
old backup files still remain. Why does RMAN not delete
all of my older files?
Answer: RMAN is not
removing all of the files because some of them may still be
needed for a full recovery! It's all about how RMAN
defines an obsolete file. Generally, an obsolete file is
one that supplements a full backup that will never be used for a
recovery and roll-forward.
The Oracle docs note the rules for a file becoming obsolete:
'DELETE OBSOLETE does not delete backups required to satisfy the
specified retention policy, even if some backups have KEEP UNTIL
times set which have passed to override the retention policy.
Backups are never obsolete if they are still
needed to meet the retention policy, regardless of any KEEP
UNTIL time. With a recovery window-based retention policy, even
if the specified KEEP UNTIL time has expired, the backup is
retained if the backup is needed to satisfy the recovery window.
With a redundancy-based retention policy, even if the
specified KEEP UNTIL time has expired, the backup is retained as
long as it is required to satisfy the redundancy requirement. '
You can also use the REDUNDANCY or RECOVERY
WINDOW clauses with DELETE to delete backups obsolete under a
specific retention policy instead of the configured default:
DELETE OBSOLETE
REDUNDANCY = 3;
DELETE OBSOLETE RECOVERY WINDOW OF 7 DAYS;