Oracle9i Recovery Manager User's Guide
Release 1 (9.0.1)

Part Number A90135-01
Go To Documentation Library
Go To Product List
Book List
Go To Table Of Contents
Go To Index

Master Index


Go to previous page Go to next page

RMAN Concepts III: Maintenance

This chapter describes the basic concepts involved in using the Recovery Manager (RMAN) utility.

This chapter contains these topics:

RMAN Reporting Functionality

The RMAN repository, which is either a recovery catalog or the target database control file, contains a wealth of metadata about backups and copies as well as other useful things such as database schema and configuration settings. You can use RMAN commands LIST, REPORT, and SHOW to access this repository information.

This section contains these topics:

LIST Command Output

The LIST command queries the RMAN repository (recovery catalog or control file) and produces a record of its contents. Use this command to obtain data about:

RMAN records the output to either standard output or the message log, but not to both at the same time. You can also control how the output is organized as well as the level of detail in the output. Running the LIST command is usually preferable to querying V$ or recovery catalog views.

The LIST command displays the same files that the CROSSCHECK and DELETE commands operate on. Consequently, you can issue LIST to see what is in the repository, and then run CROSSCHECK to ensure that these files exist on disk or tape.

See Also:

REPORT Command Output

This section contains these topics:

About RMAN Reports

RMAN reports are intended to provide analysis of your backup and recovery situation. An RMAN report can answer questions such as:

Run the REPORT NEED BACKUP and REPORT UNRECOVERABLE commands regularly to ensure that the necessary backups are available to perform media recovery, as well as to ensure that you can perform media recovery within a reasonable amount of time. Also, run REPORT OBSOLETE regularly so that you can delete unnecessary files and conserve disk space.


A datafile that does not have a backup is not considered unrecoverable. You can recover such datafiles through the CREATE DATAFILE statement if redo logs starting from when the file was created still exist. 

Reports of Obsolete Backups

The REPORT OBSOLETE command displays backups and copies of datafiles, control files, and archived redo logs that can be deleted because they are no longer needed. You can define what makes a file obsolete in the following mutually exclusive ways:

Parameter  Meaning 


At least integer more recent backups or image copies of this file already exist. 


The backup or copy is not needed for recovery to a random point within the recovery window of integer days. For each datafile, one backup that is older than the recovery window must exist. In other words, one backup of each datafile must satisfy the condition SYSDATE - CHECKPOINT_TIME >= RECOVERY WINDOW. All backups older than the most recent backup that satisfies this condition are obsolete. 

In addition to obsolete datafile backups, RMAN reports obsolete archived logs and archived log backups. Regardless of which parameter is specified, RMAN uses this setting to determine which backups and copies of datafiles are no longer needed, which in turn determines when archived logs (and backups of archived logs) are no longer needed. The creation of a datafile is considered as a backup when deciding which logs to keep.

You can specify the REDUNDANCY and RECOVERY WINDOW parameter options in these places, listed in order of precedence:

  1. The REPORT OBSOLETE command


The REPORT OBSOLETE options override the CONFIGURE options. In other words, if you configure a retention policy to a recovery window of 7 days, and then run REPORT OBSOLETE REDUNDANCY 2, the REPORT OBSOLETE command displays backups and copies that are obsolete because they have REDUNDANCY 2. The configured retention policy is still in effect: the REPORT command displays what is obsolete given the options that specified in the command. If you run REPORT OBSOLETE and specify neither the REDUNDANCY nor RECOVERY WINDOW options, then RMAN displays what is obsolete given the configured retention policy.

If you disable the retention policy, that is, if you run CONFIGURE RETENTION POLICY TO NONE, then RMAN does not consider any backups or copies as obsolete. If you then run REPORT OBSOLETE with no other options, then RMAN issues an error message because no retention policy is configured to mark files as obsolete.


An obsolete backup differs from an expired backup. An obsolete backup is no longer needed according to the user's retention policy. An expired backup is a backup that the CROSSCHECK command fails to find on the specified media device. 

See Also:

Oracle9i Recovery Manager Reference for CONFIGURE command syntax 

Reports of Orphaned Backups

The REPORT OBSOLETE ORPHAN command displays orphaned backups. Orphaned backups are backups that are unusable because they belong to incarnations of the database that are not direct ancestors of the current incarnation.

A new incarnation of a database occurs whenever you open a database with the RESETLOGS option, which resets the current redo log to log sequence 1. The RESETLOGS option causes Oracle to write a new RESETLOGS SCN into the control file and datafile headers. To prevent possible redo corruption, archived redo logs from a database with one RESETLOGS SCN cannot be applied to a database with a different RESETLOGS SCN. Although the database is the same, that is, it has the same dbid, the database can go through different incarnations depending on how often a RESETLOGS operation is performed.

RMAN can reset a database to a previous incarnation. For example, if you perform a RESETLOGS operation on database prod1 on Tuesday, you can use RMAN to reset the current database incarnation to Monday's incarnation and restore backups and archived redo logs associated with it. For this reason, backups from previous incarnations are in some cases still usable.

The situation can become complicated when a database goes through multiple incarnations. In such cases, some backups can become unusable, that is, orphaned. You should delete orphaned backups to conserve disk or tape space. The incarnation scenario depicted in Figure 7-1 shows a database that goes through three incarnations.

Figure 7-1 Orphaned Backups

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

Incarnation A of the database started at SCN 1. At SCN 10, assume that you performed a RESETLOGS operation and created incarnation B. At SCN 20, you performed another RESETLOGS operation on incarnation B and created a new incarnation C.

The following table explains which backups are orphans depending on which incarnation is current.

Current Incarnation  Usable Backups (Nonorphaned)  Orphaned Backups 

Incarnation A 

All backups from incarnation A 

All backups from incarnations B and C 

Incarnation B 

  • All backups from incarnation A prior to SCN 10

  • All backups from incarnation B

  • Backups from incarnation A after SCN 10.

  • All backups from incarnation C

Incarnation C 

  • All backups from incarnation A prior to SCN 10

  • All backups from incarnation B prior to SCN 20

  • All backups from incarnation C

  • All backups from incarnation A after SCN 10

  • All backups from incarnation B after SCN 20

See Also:

"Reporting on Backups, Copies, and Database Schema" to learn how to generate reports, and Oracle9i Recovery Manager Reference for REPORT syntax 

SHOW Command Output

The SHOW command can display any configuration set by the CONFIGURE command. For example, to display the CONFIGURE CHANNEL settings, run SHOW CHANNEL. You can also run SHOW ALL to display all current configurations.

See Also:

"Showing RMAN Configuration Settings" to learn how to show RMAN configurations, and Oracle9i Recovery Manager Reference for SHOW syntax 

PRINT SCRIPT Command Output

The PRINT SCRIPT command displays the text of a specified RMAN scripts stored in the recovery catalog. Note that this command does not display the list of all the scripts stored in the catalog. To see the list of all catalog scripts, query the recovery catalog view RC_STORED_SCRIPT_LINE.

See Also:

"Printing Scripts Stored in the Recovery Catalog" to learn how to display stored scripts, and Oracle9i Recovery Manager Reference for PRINT SCRIPT syntax 

Crosschecks of RMAN Backups and Copies

Sometimes backups and copies disappear from disk, or tapes in the media management library become unavailable. For example, someone may inadvertently delete backup pieces from disk, or one of the tapes used by the media manager may become corrupted.

To ensure that data about backup sets and image copies in the recovery catalog or control file is synchronized with actual files on disk or in the media management catalog, perform a crosscheck. The CROSSCHECK command operates only on files that are recorded in the RMAN repository.

Figure 7-2 illustrates a crosscheck of the media manager. RMAN queries the repository (recovery catalog or target database control file) for the names and locations of the four backup sets to be checked. RMAN sends this information to the target database server, which queries the media management software about the backups. The media management software then checks its media catalog and reports back to the server that backup set 3 is missing.

Figure 7-2 Crosschecks

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

Crosschecks are a useful tool because they can

Use the crosscheck feature to check the status of a backup or copy on disk or tape. If the backup or copy is on disk, then CROSSCHECK determines whether the header of the backup piece is valid. If the backup is on tape, then the command simply checks that the backups exist.

If a backup piece is unreadable or absent, then RMAN marks the backup piece EXPIRED in the output of the LIST command and the recovery catalog views. If it was marked EXPIRED but is now available, then RMAN marks the backup piece as AVAILABLE in the output of the LIST command and the recovery catalog views.

You can issue the DELETE EXPIRED command to delete all expired backups and copies. RMAN removes the record for the expired file from the repository. If for some reason the file still exists on the media, then RMAN issues an error and aborts the delete operation.


The CROSSCHECK command does not delete operating system files or remove repository records. You must use the DELETE command for these operations. 

See Also:

Deletion of RMAN Backups and Copies

This section contains these topics:

About RMAN Deletion

Every RMAN backup or copy produces a corresponding record in the control file and, if used, recovery catalog. For example, if you generate a full database backup set, and you are using a recovery catalog, then you can see the record for this backup set in the V$BACKUP_SET control file view. If you use a recovery catalog, then you can also see the record in the RC_BACKUP_SET catalog view.

The V$ control file views and catalog tables differ in the way that they store information, and this affects how RMAN handles repository records. The RMAN information stored in the control file is not stored in an actual table, although the V$ views display it in tabular format. The data is stored in an internal data structure in the circular reuse section of the control file. In contrast, the recovery catalog data is stored in actual database tables.

When you use an RMAN command to delete a backup or copy, RMAN performs the following steps:

Because of the way that control file data is stored, RMAN cannot delete the record from the control file, only update it to DELETED status. However, because the catalog tables are ordinary database tables, RMAN removes rows from them.

Table 7-1 describes the functionality of the various RMAN deletion commands and scripts. None of these commands or scripts requires a recovery catalog.

Table 7-1 Maintenance Commands and Scripts 
Command or Script  Purpose 


To delete physical backups and image copies, update the control file records to status DELETED, and remove their records from the catalog (if a catalog is used). You can specify that DELETE should remove backups or copies that are EXPIRED or OBSOLETE


To back up archived logs, datafile copies, or backup sets, then delete the input files from the operating system after the successful completion of the backup. RMAN also deletes and updates repository records for the deleted input files.

If you specify DELETE INPUT (without ALL), then RMAN deletes only the copy that it backs up. If you specify ALL, then RMAN deletes all copies of the specified logs that it finds in the V$ARCHIVED_LOG view. 


To delete recovery catalog records for specified backups and copies and change their control file records to status DELETED. Note that the CHANGE ... UNCATALOG command does not delete files from the operating system. 


To remove all records of backups or copies with status DELETED from the recovery catalog. Prior to release 8.1.6, RMAN sometimes updated recovery catalog records to DELETED status rather than removing them entirely (as it does in the current release). Catalog records are only marked DELETED if the catalog has been upgraded or the catalog was resynchronized from a backup control file. 

Use the RMAN deletion commands rather than operating system utilities to delete RMAN backups and copies, because RMAN removes the records for the deleted files from the catalog and marks control file records as DELETED. If you delete files using an operating system command, then the RMAN repository still has the records for these files. Hence, the repository and physical files are not synchronized.

In this situation, you can issue the CROSSCHECK command, which marks these records as EXPIRED. Then, you can run the DELETE EXPIRED command to remove the expired records from the catalog (if you use one) and update the records to DELETED in the control file. Also, you can simply run DELETE on the specific files that you already removed from the operating system.

Alternatively, you can run the CHANGE ... UNCATALOG command. This command removes catalog records for the specified backups and copies and updates their control file records to status DELETED. It does not touch any physical backups and copies that may exist.

See Also:

"Crosschecks of RMAN Backups and Copies" 

Removal of Backups and Copies with the DELETE Command

The DELETE command can remove any file that the LIST and CROSSCHECK commands can operate on. For example, you can delete backup sets, archived redo logs, and datafile copies. The DELETE command removes both the physical file and the catalog record for the file.

Advantage of Using DELETE Instead of Operating System Commands

Always use DELETE rather than an operating system utility to remove RMAN backups and copies. If you do not, then the RMAN repository is not synchronized with what exists on the file system or on tape. If you remove files using an operating system utility, you can

Deletion of Obsolete Backups and Copies

The DELETE OBSOLETE command provides a convenient way to physically delete backups and copies that are no longer needed, as well as remove their catalog records. It uses the same REDUNDANCY, RECOVERY WINDOW, and ORPHAN options as the REPORT OBSOLETE command.

If you have configured a retention policy, then you can run DELETE OBSOLETE periodically to delete all backups and copies considered obsolete by this policy. For example, you can run DELETE OBSOLETE as a script every night using a scheduling utility. In this way, you keep your disk drives uncluttered by removing all unnecessary files.

See Also:

"Reports of Obsolete Backups" 

Deletion of Expired Backups

The CROSSCHECK command marks a backup or copy as expired when it cannot locate it at the location to which it was backed up. In short, expired means "not found." You can view the expired backups and copies by running the LIST command, as in the following example:


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=8 devtype=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/oracle/dbs/01clvucn_1_1 recid=1 stamp=425720217
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/oracle/dbs/03clvueg_1_1 recid=3 stamp=425720273

The DELETE EXPIRED command removes the recovery catalog records for expired backups and copies, and updates their control file records to status DELETED.

This command is especially useful if you inadvertently delete RMAN backups or archived logs from disk using an operating system utility. If you do this, then the RMAN repository is not synchronized with the physical reality of what is on disk. By running the CROSSCHECK command, RMAN marks the backups and copies that it cannot find as expired. Then, you can run DELETE EXPIRED to remove the records for these files.

Occasionally, a backup or copy marked EXPIRED can reappear. For example, you may move archived logs to a new directory, then run an RMAN crosscheck. The logs are now marked as expired. If you move the logs back to their original directory without running another crosscheck, then the repository does not reflect the reality of what is on disk. In this case, DELETE EXPIRED aborts with an error because the expired files actually exist.

Removal of Backups and Copies with the BACKUP ... DELETE INPUT Command

The BACKUP ... DELETE INPUT command can delete archived redo logs, datafile copies, and backup sets after backing them up. This functionality is especially useful when backing up archived logs on disk to tape. RMAN backs up one and only one copy of each log sequence number, and then deletes the file that it backs up. For example, assume that you issue:


In this command, RMAN backs up one copy of each log for each available sequence number, and then deletes only the file that it actually backs up.

If you specify the DELETE ALL INPUT option, then RMAN deletes whichever files match the criteria that you specify, even if there are several files of the same log sequence number. For example, assume that you archive to 3 different directories. Then, you issue this command:


In this case, RMAN backs up only one copy of each log sequence between 1200 and the most recent sequence, but deletes all logs with these sequence numbers contained in the three archive destinations.

The archived log failover feature means that RMAN searches every enabled archiving destination for good copies of a log sequence number. For example, assume that /log1 and /log2 are the only enabled archiving destinations, and that they contain the same sequence number. You run this command:


RMAN can start reading from any enabled archiving directory. For example, assume RMAN starts in directory /log1 and finds log_123.f there. Then, if RMAN discovers that log_124.f is corrupt, it searches in /log2 for a good copy of this log. Because DELETE ALL INPUT is specified, RMAN deletes all copies of logs on disk of sequence 123 and higher.

See Also:

Allocation of Multiple Channels for RMAN Maintenance Commands

You can use maintenance commands such as CROSSCHECK or DELETE on all configured device types. If you have automatic channels configured for all devices on which you have made backups, then you can simply run CROSSCHECK or DELETE at the RMAN prompt as in the following example (sample output included):


using channel ORA_SBT_TAPE_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=14 devtype=DISK

RMAN uses the default configured DISK channel as well as a channel for the configured sbt device. RMAN looks for each backup on all channels that have the same device type as the channel used to create the backup. The multiple-channel crosscheck feature is designed for the following scenarios:

To perform maintenance on files on only one device type, you can specify the device type on the maintenance command itself. For example:


If you do not have an automatic channel configured, then you can manually allocate a maintenance channel. For example, you can run commands as follows:


See Also:

Changes to Availability of RMAN Backups and Copies

RMAN can update the repository to show backups and copies as available or unavailable. For example, you may have several backups on a tape drive that is being upgraded or replaced. You can use the CHANGE ... UNAVAILABLE command to mark these backups and copies as unavailable for the duration of the maintenance on the drive. RMAN does not consider UNAVAILABLE backups and copies for its backup and recovery operations.

When the maintenance is complete, you can issue the CHANGE ... AVAILABLE command to inform RMAN that these backups and copies are now available again. After setting the files back to status AVAILABLE, you can also run a CROSSCHECK to double-check that RMAN can access the files.

See Also:

Changes to Retention Status of RMAN Backups and Copies

RMAN can change the status of backups and copies by using the KEEP or NOKEEP options. The KEEP option exempts a backup or copy from the current retention policy either indefinitely or until the specified UNTIL time. RMAN does not mark the files as obsolete even if they would be considered obsolete under the retention policy. Such backups are called long-term backups. The NOKEEP option removes the exempt status of the files.

The CHANGE ... KEEP or CHANGE ... NOKEEP commands alter the retention status of a backup or copy. For example, this command allows the retention policy to mark backup sets with the tag save_backup as obsolete:


See Also:

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

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

Master Index