• Arun Kumar

Delete RMAN Backups

There are many ways to delete RMAN backups and as a DBA you must know the different ways so that you can keep RMAN and OS disk space clean.


Delete all backups


To delete all the backups for the target database, use below command

RMAN> DELETE BACKUP;

The above command will prompt you to confirm the deletion. In case you are sure to delete the backups and want to skip the confirmation prompt then use below command

RMAN> DELETE NOPROMPT BACKUP;

Deleting archivelog backup


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

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

To delete archivelog files from the RMAN backups (NOT DISK), use below commands

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


Delete backup tag


If you triggered a backup and want to delete it completely, you can specify the backup tag and rman will delete all the backup files associated with tag

RMAN> DELETE BACKUP TAG <tag>;

Delete expired backups


First run RMAN CROSSCHECK command and then use below command to delete all the expired backups

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


Delete obsolete backups


You can run REPORT OBSOLETE command to see all the rman backups that are no longer required for database recovery. Use below command to delete all the RMAN obsolete backups

RMAN> DELETE OBSOLETE;


Delete while taking backup


You can use DELETE INPUT clause to delete files while taking RMAN backups

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




Recent Posts

See All

Perform Manual Switchover on Physical Standby

Connect to proddb database via client: Take a new putty session and connect to proddb database via client machine. Keep querying below sqlplus sys/sys@proddb as sysdba SQL> select name, open_mode, db

How to check database backups

Checking Database backups are one of the main focus areas of a DBA. Time to time, DBA needs to check database backup status and see if its completed, failed, running etc. Also, DBA must be able to get

Automate RMAN Backups using Shell Scripts

In a real environment, off course you will not manually trigger all the Oracle database backups. You need an automated mechanism to trigger RMAN backups. In this article we will look at RMAN backup au

  • Facebook
  • Twitter
  • YouTube
  • Instagram

© 2020 by DBA Genesis

Feedback