Deleting RMAN Backups

posted Sep 16, 2010, 8:07 AM by Sachchida Ojha
You can use RMAN to delete backups created with RMAN. Deleting backups using RMAN both deletes the specified backups and updates the RMAN repository to reflect the deletion.

Deleting Specified Backups

In general, use the DELETE command to remove backups that you do not want to retain. DELETE removes the physical files from the backup media, deletes the record of the backup from the recovery catalog (if RMAN is connected to a recovery catalog), and updates the records of these backups in the control file to status DELETED.

The DELETE command supports deleting several types of backups, including:

DELETE BACKUP (which deletes backup sets, proxy copies, and image copies), DELETE COPY (which deletes only image copies), or DELETE ARCHIVELOG as in these examples:

The DELETE command supports a wide range of options to identify backups to delete. For complete information about these options, see Oracle Database Backup and Recovery Reference. The following examples show many of the common ways to specify backups and archived logs to delete using theDELETE command:

  • Deleting backups using primary keys from LIST output:

    DELETE BACKUPPIECE 101;
    
    
  • Deleting backups by filename on disk:

    DELETE CONTROLFILECOPY '/tmp/control01.ctl';
    
    
  • Deleting archived redo logs from disk:

    DELETE NOPROMPT ARCHIVELOG UNTIL SEQUENCE = 300;
    
    
  • Deleting backups based on tags:

    DELETE BACKUP TAG='before_upgrade';
    
    
  • Delete backups based on the objects backed up and the media or disk location where the backup is stored:

    DELETE BACKUP OF TABLESPACE users DEVICE TYPE sbt; # delete only from tape
    DELETE COPY OF CONTROLFILE LIKE '/tmp/%';  # 
    
    
  • Delete all backups for this database recorded in the RMAN repository:

    DELETE BACKUP; 
    
    
  • Delete backups and archived redo logs from disk based on whether they are backed up on tape:

    DELETE ARCHIVELOG ALL 
       BACKED UP 3 TIMES TO sbt; 
    
    

If you run RMAN interactively, then RMAN asks for confirmation before deleting any files. You can suppress these confirmations by using the NOPROMPT keyword with any form of the BACKUP command:

DELETE NOPROMPT ARCHIVELOG ALL; 
  

Comments