RMAN Delete
Delete backups (and copies) from disk or tape, and update the RMAN repository.
Syntax:
DELETE [FORCE] [NOPROMPT] { [EXPIRED] {
{ BACKUP [OF listObjectList] | COPY [OF listObectjList] | archivelogRecordSpecifier
} [maintQualifier [maintQualifier]…] | recordSpec [DEVICE TYPE deviceSpecifier [, deviceSpecifier]…] }
| OBSOLETE [obsOperandList] [DEVICE TYPE (deviceSpecifier [, deviceSpecifier]…] };
obsOperandList::=
[ REDUNDANCY [=] integer | RECOVERY WINDOW OF integer DAYS | ORPHAN ]…
recordSpec::=
{ { BACKUPPIECE | PROXY }
{ ‘media_handle’ [, ‘media_handle’]…
| primary_key [, primary_key]…
| TAG [=] [‘] tag_name [‘] }
| BACKUPSET primary_key [, primary_key]…
| { CONTROLFILECOPY | DATAFILECOPY }
{ { primary_key [, primary_key]…
| ‘filename’ [, ‘filename’]…
}
| TAG [=] [‘] tag_name [‘] [, [‘] tag_name [‘]]…
}
| ARCHIVELOG
{ primary_key [, primary_key]…
| ‘filename’ [, ‘filename’]…
}
}
listObjectList::=
[ DATAFILE datafileSpec [, datafileSpec]…
| TABLESPACE [‘] tablespace_name [‘] [, [‘] tablespace_name [‘]]…
| archivelogRecordSpecifier
| DATABASE [SKIP TABLESPACE [‘] tablespace_name [‘] [, [‘] tablespace_name [‘]]…] | CONTROLFILE
| SPFILE
]…
Examples
RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt;
RMAN> CROSSCHECK BACKUP OF TABLESPACE user_data COMPLETED BEFORE ‘SYSDATE-14′; RMAN> DELETE NOPROMPT EXPIRED BACKUP OF TABLESPACE user_data COMPLETED BEFORE ‘SYSDATE-14′;
RMAN> DELETE BACKUP OF DATABASE LIKE ‘/tmp%’;
RMAN> DELETE ARCHIVELOG ALL BACKED UP 2 TIMES TO DEVICE TYPE sbt;
RMAN> DELETE BACKUPSET 101, 102, 103;
RMAN> DELETE CONTROLFILECOPY ‘/tmp/cntrlfile.copy’;
RMAN> DELETE BACKUP OF SPFILE TABLESPACE users DEVICE TYPE sbt;Delete backups and copies (and archived redo logs ) that will not be needed to perform any possible recovery of the database to any point in the last 7 days.
DELETE NOPROMPT OBSOLETE RECOVERY WINDOW OF 7 DAYS;