DBAtlas · Database operations atlas

Validate and clean up RMAN backup records (CROSSCHECK, EXPIRED, OBSOLETE)

OracleRMAN

Command

SHOW RETENTION POLICY;
# 1) Compare records with the physical files (missing ones become EXPIRED):
CROSSCHECK BACKUP;
CROSSCHECK COPY;
CROSSCHECK ARCHIVELOG ALL;
# 2) Review before deleting:
LIST EXPIRED BACKUP;
LIST EXPIRED ARCHIVELOG ALL;
REPORT OBSOLETE;
# 3) Clean up:
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT EXPIRED COPY;
DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
DELETE NOPROMPT OBSOLETE;

What it does

CROSSCHECK checks whether the backups in the RMAN records still exist on disk/tape; DELETE EXPIRED removes the records of missing files, and DELETE OBSOLETE deletes backups no longer needed by the retention policy from both the records and the disk.

When to use it

When backup files were deleted/moved at the OS level, when the FRA fills up, and as part of the regular backup maintenance job.

Caution

DELETE OBSOLETE physically deletes files; verify the list with REPORT OBSOLETE first and make sure the retention policy (RECOVERY WINDOW / REDUNDANCY) is what you expect. If you run CROSSCHECK while the tape/media manager is temporarily unreachable, valid backups show as EXPIRED; do not run DELETE EXPIRED at that moment.

Open in DBAtlas →

Related