RMAN Backup Delete Commands


I was being asked how to delete the RMAN backup. So I thought lets write a quick post on this

Delete All Backups


RMAN> DELETE BACKUP;

The above command will prompt you to confirm the deletion. 

Delete the backups and want to skip the confirmation prompt then use below command

RMAN> DELETE NOPROMPT BACKUP;


Delete Archivelog Backup

To delete archivelog files from disk (NOT BACKUP), use below commands

RMAN> DELETE ARCHIVELOG ALL;
RMAN> DELETE ARCHIVELOG UNTIL SEQUENCE 1000;
RMAN> DELETE ARCHIVELOG ALL COMPLETED BEFORE ‘sysdate-7;
RMAN> DELETE ARCHIVELOG ALL BACKED UP 1 TIMES to disk;

To delete archivelog files from the RMAN backups (NOT ON DISK)

RMAN> DELETE BACKUP OF ARCHIVELOG ALL;
RMAN> DELETE BACKUP OF ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';


Delete Backup Tag

Delete all the backup files associated with tag

RMAN> DELETE BACKUP TAG <tag>;


Delete Expired Backups

Run RMAN CROSSCHECK command and then delete all the expired backups

RMAN> CROSSCHECK BACKUP;
RMAN> DELETE EXPIRED BACKUP;
RMAN> DELETE EXPIRED ARCHIVELOG ALL;


Delete Obsolete Backups

We can run REPORT OBSOLETE command to see all the rman backups that are no longer required for database recovery. 

RMAN> DELETE OBSOLETE;


Delete Archivelog While Backup

We can use DELETE INPUT clause to delete files while taking RMAN backups to delete them after backup.

RMAN> BACKUP ARCHIVELOG ALL DELETE INPUT;
RMAN> BACKUP ARCHIVELOG ALL FROM SEQUENCE 9996 DELETE ALL INPUT;





If you like please follow and comment