Delete RMAN Backups
It will delete all EXPIRED backups from RMAN repository.
RMAN
Retention Policy
rman target /
RMAN> SHOW ALL;
CONFIGURE
RETENTION POLICY TO RECOVERY WINDOW OF 4 DAYS;
What is an Obsolete Backup?
Backup that we have in our system (both on RMAN
catalog, and as physical RMAN backup files at the file system level) that is
older than 4 days is considered obsolete.
View Backups before Delete Obsolete?
RMAN> LIST BACKUP SUMMARY;
Perform RMAN CrossCheck:
Crosscheck backup command will check for the
records in the RMAN repository to make sure they are accurate.
RMAN> CROSSCHECK BACKUP;
Delete Obsolete RMAN backup:
Once the crosscheck is done, it is time to
delete the old obsolete backup using the DELETE OBSOLETE command as shown
below.
RMAN> DELETE OBSOLETE;
OR
RMAN> DELETE NOPROMPT OBSOLETE;
View Backups After Delete Obsolete
RMAN> LIST BACKUP SUMMARY;
Delete Expired Backup:
What is an Expired Backup?
When you have an entry in the RMAN repository
for a backup, but there are no corresponding physical rman backup files at the
filesystem level, that is considered as expired entry.
Perform RMAN CrossCheck:
RMAN> CROSSCHECK BACKUP;
RMAN> LIST BACKUP SUMMARY;
Delete Expired RMAN Catalog Entries
RMAN>
DELETE EXPIRED BACKUP;
View Backups after Delete Expired:
RMAN> LIST BACKUP
SUMMARY;
List backupset:
LIST BACKUP SUMMARY;
CROSSCHECK BACKUP;
DELETE OBSOLETE;
DELETE EXPIRED
BACKUP;
You can check the backup of the specific file:
list backup of
datafile 4;
Delete archivelogs:
crosscheck archivelog all;
delete noprompt expired archivelog all;
list backup;