Oracle9i Recovery Manager Reference Release 2 (9.2) Part Number A96565-01 |
|
RMAN Commands , 23 of 59
To delete physical backups and copies as well as do the following:
DELETED
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 |
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. Specify a retention policy by using CONFIGURE
RETENTION
POLICY
or the REDUNDANCY
and RECOVERY
WINDOW
options on the DELETE
command.
The repository record for an object can sometimes fail to reflect the physical status of the object. For example, you back up a log to disk and then use an operating system utility to delete the object. If you do not run the CROSSCHECK
command to update the repository, and if you then run DELETE
against the object, then the repository shows that the object is AVAILABLE
while the object is in fact missing. The following table indicates the behavior of DELETE
in such situations.
See Also:
"BACKUP" to learn about the |
DELETE
is used with a file that is disk-only (that is, an ARCHIVELOG
, DATAFILECOPY
, CONTROLFILECOPY
). Otherwise, you must use a manual or automatic maintenance channel.
If you use DELETE
on files that are not disk-only, and if you have objects created on device types that are not configured for automatic channels, then run manual maintenance commands on these channels. For example, if you created a backup using an sbt
channel, but have only a DISK
channel automatically configured, you must manually allocate an sbt
channel for DELETE
.
Syntax Element | Description |
---|---|
|
Deletes specified files (whether or not they exist on the media) and removes repository records. RMAN ignores any I/O errors for the deleted objects. RMAN displays the number of deleted objects at the end of the job. |
|
Deletes specified files without first listing the files or prompting for confirmation. The |
|
Removes only files whose status in the repository is Note: Beginning in Oracle9i, RMAN's default behavior is to prompt for confirmation when you run |
|
Deletes backup sets, backup pieces, and proxy copies. By default, RMAN deletes backups of the whole database. Specify the |
|
Deletes datafile copies, archived redo logs, and image copies of archived redo logs. By default, |
|
restricts the list of objects operated on to the object type specified in the |
restricts the command based on the specified options (see "maintQualifier"). Note: listObjList and maintQualifier are valid options on both the |
|
Deletes the specified archived redo logs. See Also: "archivelogRecordSpecifier" |
|
Specifies the object that you are deleting. See Also: "recordSpec" |
|
|
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 |
|
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 |
Specifies the criteria for determining which backups and copies are obsolete. See Also: "obsOperandList" |
|
|
Restricts the deletion to obsolete backups and copies created on the specified device type only. See Also: "deviceSpecifier" |
The following example uses a configured sbt
channel to check the media manager for expired backups of the tablespace users
that are more than one month old and removes their catalog records:
CROSSCHECK BACKUP OF TABLESPACE users DEVICE TYPE sbt COMPLETED BEFORE 'SYSDATE-31'; DELETE NOPROMPT EXPIRED BACKUP OF TABLESPACE users DEVICE TYPE sbt COMPLETED BEFORE 'SYSDATE-31';
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;
The following example deletes backups and copies (including archived redo logs) that have already been backed up at least twice to tape:
DELETE NOPROMPT BACKUP BACKED UP 2 TIMES TO DEVICE TYPE sbt; DELETE NOPROMPT COPY BACKED UP 2 TIMES TO DEVICE TYPE sbt;
The following example attempts to delete the backup set copy with tag weekly_bkup
:
DELETE NOPROMPT BACKUPSET TAG weekly_bkup;
However, RMAN displays a warning because the repository shows the backup set as available, but the object is not actually available on the media:
RMAN-06207: WARNING: 1 objects could not be deleted for SBT_TAPE channel(s) due RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status List of Mismatched objects ========================== Object Type Filename/Handle --------------- --------------------------------------------------- Backup Piece 0id270ud_1_1
The following command forces RMAN to delete the backup:
DELETE FORCE NOPROMPT BACKUPSET TAG weekly_bkup;
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|