Pages

Wednesday, March 8, 2017

RMAN Delete Command

RMAN Delete Command



The RMAN DELETE command deletes backups from disk and/or from the catalog

To delete all backups for the target database use:

RMAN> DELETE BACKUP;
Delete Backupset

To delete a backup set specify the set number e.g. 23:

RMAN> DELETE BACKUPSET 23;
NOPROMPT keyword

By default the DELETE command will prompt for confirmation before deleting any backup files

Do you really want to delete the above objects (enter YES or NO)?
To suppress the prompt specify the NOPROMPT keyword. For example:

RMAN> DELETE NOPROMPT BACKUP;
Image Copies

To delete all datafile copies:

RMAN> DELETE DATAFILECOPY ALL;
To delete an individual datafile copy use:

RMAN> DELETE DATAFILECOPY <key>;
For example:

RMAN> DELETE DATAFILECOPY 26;
Alternatively specify the datafile image copy name. For example:

RMAN> DELETE DATAFILECOPY '/u01/app/oracle/copy/users01.dbf';
To delete a specific controlfile copy use:

RMAN> DELETE CONTROLFILECOPY <key>;
For example:

RMAN> DELETE CONTROLFILECOPY 20;
Alternatively specify the control file copy name e.g.:

RMAN> DELETE CONTROLFILECOPY '/u01/app/oracle/copy/cf_D-TEST_id-2066695660_1tqek8bd';
To delete all backups of the USERS tablespace use:

RMAN> DELETE BACKUP OF TABLESPACE USERS;
Expired Backups

To delete any expired backups detected by the CROSSCHECK command use:

RMAN> DELETE EXPIRED BACKUP;
To delete all expired archive logs detected by the CROSSCHECK command use:

RMAN> DELETE EXPIRED ARCHIVELOG ALL;
Obsolete Backups

To delete backups that have become obsolete based on the retention policy.

RMAN> DELETE OBSOLETE;

No comments:

Post a Comment