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 , 39 of 60


RECOVER

Syntax


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

recoverObject::=


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

recoverOptionList::=


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

Purpose

To apply redo logs or incremental backups to one or more restored datafiles in order to update them to a specified time.

RMAN uses online redo records and restores backup sets of archived redo logs as needed to perform the media recovery. RMAN first looks for the original archived logs or image copies, and if none are available, then it restores backups.

If RMAN has a choice between applying an incremental backup or applying redo, then it always chooses the incremental backup. If overlapping levels of incremental backup are available, then RMAN automatically chooses the one covering the longest period of time. Note that RMAN can apply incremental backups to restored files that were not created as part of an incremental backup.


Note:

When RMAN applies incremental backups, it recovers changes to objects created with the NOLOGGING option. Applying archived redo logs to datafiles does not recover these changes. 


See Also:

Oracle9i Recovery Manager User's Guide to learn how to recover datafiles 

Restrictions and Usage Notes

Keywords and Parameters

DEVICE TYPE deviceSpecifier 

Allocates automatic channels for the specified device type only. For example, if you configure automatic disk and tape channels, and issue RECOVER ... DEVICE TYPE DISK, then RMAN allocates only disk channels.

See Also: "deviceSpecifier" 

DATABASE 

Specifies that the entire database is to be recovered. Unless you specify an untilClause, RMAN performs complete recovery. 

 

untilClause 

Specifies a noncurrent time, SCN, or log sequence number for termination of the RECOVER command. You must open the database with the RESETLOGS option after incomplete recovery.

See Also: "untilClause" 

 

SKIP [FOREVER] TABLESPACE 

Lists tablespaces that should not be recovered, which is useful for avoiding recovery of tablespaces containing only temporary data or for postponing recovery of some tablespaces. The SKIP clause takes the datafiles in the specified tablespaces offline before starting media recovery. These files are left offline after the media recovery is complete.

If you perform incomplete recovery, then SKIP is not allowed. Instead, use SKIP FOREVER, with the intention of dropping the skipped tablespaces after opening the database with the RESETLOGS option. The SKIP FOREVER clause causes RMAN to take the datafiles offline with the DROP option. Only use SKIP FOREVER when the specified tablespaces will be dropped after opening the database. 

TABLESPACE 'tablespace_name' 

Specifies tablespaces by tablespace name. 

DATAFILE datafileSpec 

Specifies a list of one or more datafiles to recover. Specify datafiles by either filename (by using a quoted string) or absolute datafile number (by using an integer).

If you are using the control file as the exclusive repository for RMAN metadata, then the filename must be the name of the datafile as known in the control file.

If you are using a recovery catalog, then the filename of the datafile must be the most recent name recorded in the catalog. For example, assume that a datafile was renamed in the control file. The database then crashes before you can resynchronize the catalog. Specify the old name of the datafile in the RECOVER command, because this is the name recorded in the catalog.

See Also: "datafileSpec" 

recoverOptionList 

Specifies various recovery options. 

 

DELETE ARCHIVELOG 

Deletes archived logs restored from backups or copies that are no longer needed. RMAN does not delete archived logs that were already on disk before the RESTORE command started. 

 

CHECK READONLY 

Checks the headers of read-only files to ensure that they are current before omitting them from the recovery.  

 

NOREDO 

Suppresses the application of redo logs--only incremental backups are applied. This option is intended for recovery of NOARCHIVELOG databases by using incremental backups. If you do not specify NOREDO when recovering a NOARCHIVELOG database, then Oracle aborts a recovery and issues an error.

Note: Incremental backups of NOARCHIVELOG databases must be taken after a consistent shutdown.  

 

CHECK LOGICAL 

Tests data and index blocks that pass physical corruption checks for logical corruption, for example, corruption of a row piece or index entry. If RMAN finds logical corruption, it logs the block in the alert.log and server session trace file.

Provided the sum of physical and logical corruptions detected for a file remain below its MAXCORRUPT setting, the RMAN command completes and Oracle populates V$BACKUP_CORRUPTION and V$COPY_CORRUPTION with corrupt block ranges. If MAXCORRUPT is exceeded, then the command terminates without populating the views.

Note: The MAXCORRUPT setting represents the total number of physical and logical corruptions permitted on a file. 

 

FROM TAG = tag_name 

Specifies the tag for an incremental backup to be used during recovery. If the tagged backup does not contain all the necessary incrementals for recovery, then RMAN uses logs or incremental backups as needed from whatever is available. 

 

ARCHIVELOG TAG = tag_name 

Specifies the tag for an archived log backup to be used during recovery. If the tagged backup does not contain all the necessary logs for recovery, RMAN uses logs or incremental backups as needed from whatever is available. 

Examples

Recovering a Tablespace in an Open Database: Example

The following example takes tablespace tbs_1 offline, uses automatic channels to restore and recover it (deleting the logs that it restored from tape), then brings it back online:

SQL "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE";  
RESTORE TABLESPACE tbs_1; 
RECOVER TABLESPACE tbs_1 DELETE ARCHIVELOG;  
SQL "ALTER TABLESPACE tbs_1 ONLINE";

Recovering Datafiles Restored to New Locations: Example

The following example uses the preconfigured disk channel and manually allocates one media management channel to use datafile copies on disk and backups on tape, and restores one of the datafiles in tablespace tbs_1 to a different location:

RUN
{  
  ALLOCATE CHANNEL dev2 DEVICE TYPE sbt;  
  SQL "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE";  
  SET NEWNAME FOR DATAFILE 'disk7/oracle/tbs11.f' 
    TO 'disk9/oracle/tbs11.f';
  RESTORE TABLESPACE tbs_1;
  SWITCH DATAFILE ALL;
  RECOVER TABLESPACE tbs_1;  
  SQL "ALTER TABLESPACE tbs_1 ONLINE";  
}

Performing Incomplete Recovery by Using a Backup Control File: Example

Assume that both the database and archived redo log 1234 were lost due to a disk crash. Because you do not have incremental backups, you need to recover the database by using available archived redo logs. You do not need to restore tablespace readonly1 because it has not changed since log 1234.

RUN
{  
  SET UNTIL SEQUENCE 1234 THREAD 1;      # Recover database until log sequence 1234 
  RESTORE CONTROLFILE TO '/vobs/oracle/dbs/cf1.f' ;  
  # Because you specified a restore destination, manually replicate the control file.
  # RMAN replicates automatically when no destination is specified.
  REPLICATE CONTROLFILE FROM '/vobs/oracle/dbs/cf1.f';
  ALTER DATABASE MOUNT;
  RESTORE DATABASE SKIP TABLESPACE temp1, readonly1;
  RECOVER DATABASE SKIP FOREVER TABLESPACE temp1;
  ALTER DATABASE OPEN RESETLOGS;
  SQL "DROP TABLESPACE temp1";
  SQL "CREATE TABLESPACE temp1 DATAFILE '/vobs/oracle/dbs/temp1.f' SIZE 10M TEMPORARY";
}

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