Oracle9i Recovery Manager Reference
Release 1 (9.0.1)

Part Number A90136-02
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

RMAN Commands , 23 of 60


DELETE

Syntax


Text description of delete.gif follows
Text description of the illustration delete.gif

Purpose

To delete physical backups and copies as well as do the following:

By default, DELETE displays a list of the files and prompts you for confirmation before deleting any file in the list, unless you are running a command file.

If you specify the EXPIRED option, then DELETE only removes files marked EXPIRED, that is, "not found," by the CROSSCHECK command. Use the LIST command or query the recovery catalog views to determine which backups or copies are expired.


Caution:

If for some reason a backup or copy marked EXPIRED exists when you run the DELETE EXPIRED command, then RMAN deletes the physical files. 


If you specify the OBSOLETE option, then DELETE removes files considered OBSOLETE, that is, "not needed," by the retention policy or because it is orphaned. You can specify a retention policy by using CONFIGURE RETENTION POLICY, or specify the REDUNDANCY and RECOVERY WINDOW options on the DELETE command.

See Also:

"BACKUP" to learn about the BACKUP ... DELETE INPUT command 

Restrictions and Usage Notes

Keywords and Parameters

NOPROMPT 

Deletes specified files without first listing the files or prompting for confirmation. The DELETE NOPROMPT command still displays each item as it is deleted.

By default, DELETE displays files and then prompts for confirmation. If the user confirms, then RMAN shows each item as it is deleted. If you are running commands from a command file, then NOPROMPT is the default. 

EXPIRED 

Removes only files whose status in the repository is EXPIRED. RMAN marks backups and copies as expired when you run a CROSSCHECK command and the files are absent or inaccessible. To determine which files are expired, run a LIST EXPIRED command.

Note: Beginning in Oracle9i, RMAN's default behavior is to prompt for confirmation when you run DELETE EXPIRED. In releases previous to Oracle9i, RMAN did not prompt. 

OBSOLETE 

Deletes backups and datafile copies recorded in the RMAN repository that are obsolete, that is, no longer needed. In addition to obsolete datafile backups, RMAN deletes obsolete archived logs and archived log backups. RMAN determines which backups and copies of datafiles are no longer needed, which in turn determines when logs (and backups of logs) are no longer needed. RMAN considers the creation of a datafile is as a backup when deciding which logs to keep.

RMAN first uses the options that you specify with obsOperandList to determine what is obsolete. If you do not specify options in obsOperandList, then RMAN uses the options specified in CONFIGURE RETENTION POLICY

 

obsOperandList 

Specifies the criteria for determining which backups and copies are obsolete.

See Also: "obsOperandList" 

 

DEVICE TYPE deviceSpecifier 

Restricts the deletion to obsolete backups and copies created on the specified device type only.

See Also: "deviceSpecifier" 

BACKUP 

Deletes backup sets, backup pieces, and proxy copies. By default, RMAN deletes backups of the whole database. Specify the EXPIRED option to remove only backups that are marked EXPIRED in the repository. The KEY column of the LIST output indicates the primary key usable in the CHANGE and DELETE commands. 

COPY 

Deletes datafile copies, archived redo logs, and image copies of archived redo logs. By default, DELETE ... COPY removes copies of all files in the database. Specify the EXPIRED option to remove only copies that are marked EXPIRED in the repository.  

 

OF listObjList 

restricts the list of objects operated on to the object type specified in the listObjList clause. See "listObjList". If you do not specify an object, CHANGE defaults to all copies. 

 

maintQualifier 

restricts the command based on the specified options (see "maintQualifier"). 

 

Note: listObjList and maintQualifier are valid options on both the BACKUP and COPY commands. 

recordSpec 

Specifies the object that you are deleting.

See Also: "recordSpec" 

 

DEVICE TYPE deviceSpecifier 

allocates automatic channels for the specified device type only (see "deviceSpecifier"). This option is valid only if you have configured channels and have not manually allocated channels. For example, if you configure disk and tape channels, and run DELETE ... DEVICE TYPE DISK, then RMAN allocates only disk channels. 

Examples

Deleting Expired Backups: Example

The following example uses a configured sbt channel to check the media manager for expired backups of the tablespace user_data that are more than one month old and removes their catalog records:

CONFIGURE CHANNEL DEVICE TYPE sbt;
CROSSCHECK BACKUP OF TABLESPACE user_data COMPLETED BEFORE 'SYSDATE-31';
DELETE NOPROMPT EXPIRED BACKUP OF TABLESPACE user_data COMPLETED BEFORE 'SYSDATE-31';

Deleting Obsolete Backups: Example

The following example deletes backups and copies that are not needed to recover the database to a random point within the last week. RMAN also deletes archived redo logs that are no longer needed:

DELETE NOPROMPT OBSOLETE RECOVERY WINDOW OF 7 DAYS;

Deleting a Backup Set Specified by Primary Key: Example

The following example deletes backup set 503 from disk:

DELETE BACKUPSET 503;

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback