Oracle8i Backup and Recovery Guide
Release 8.1.5

A67773-01

Library

Product

Contents

Index

Prev Prev Next


restore

Syntax


restoreObject::=

restoreSpecOperand::=

Purpose

To restore files from backups or image copies to the current location, overwriting the files with the same name. RMAN restores backups from disk or tape, but only restores images copies from disk.

Typically, you restore when a media failure has damaged a current datafile, control file, or archived redo log file or prior to performing a point-in-time recovery.

This command restores full backups, incremental level 0 backups, or copies of:

The restore command does not restore incremental backups at levels greater than 0: incremental backups are applied by the recover command.

Note that when you perform a restore operation using a backup control file and use a recovery catalog, RMAN automatically adjusts the control file to reflect the structure of the restored backup.

See Also: To learn how to restore files, see Chapter 9, "Restoring and Recovering with Recovery Manager".

Requirements

Keywords and Parameters

restoreObject  

specifies the objects to be restored.  

 

controlfile  

restores the current control file and automatically replicates it to all CONTROL_FILES locations in the parameter file. If you specify a new pathname with the to 'filename' option, RMAN restores the control file to the new location: you must replicate it manually using the replicate command..  

 

database  

restores all datafiles in the database except those that are offline or read-only. If you specify the check readonly option, then RMAN will examine the headers of all read-only files and restore those that need restoring. Unlike a backup database, a restore database does not also include the control file.

Use an optional skip ... tablespace argument to avoid restoring certain tablespaces, which is useful when you want to avoid restoring tablespaces containing temporary data.  

 

datafile datafileSpec  

restores the datafiles specified by filename or absolute datafile number. See "datafileSpec".  

 

tablespace tablespace_name  

restores all datafiles in the specified tablespaces.  

 

archivelogRecord- Specifier clause  

restores the specified range of archived redo logs. See "archivelogRecordSpecifier".  

restoreSpec- Operand  

specifies options for the restoreObject clause.

Note: These parameters override the parameters with the same name at the restore command level.  

 

channel channel_id  

specifies the name of a channel to use for this restore operation. If you do not specify a channel, restore uses any available channel allocated with the correct device type.  

 

from tag tag_name  

overrides the default selection of the most recent backups or file copy available. The tag restricts the automatic selection to backup sets or file copies that have the specified tag. If multiple backup sets or file copies have a matching tag, then RMAN selects the most recent one.  

 

parms channel_parms  

specifies a quoted string containing O/S-specific information. The string is passed to the OSD layer each time a backup piece is restored.  

channel channel_id  

See the restoreSpecOperand clause.  

from tag tag_name  

See the restoreSpecOperand clause.  

parms channel_parms  

See the restoreSpecOperand clause.  

from  

specifies whether RMAN should restore from a datafilecopy on disk or a backupset. By default restore chooses the most recent backup set or file copy, i.e., the file copy or backup set that needs the least media recovery.  

untilClause  

limits the selection to those backup sets or file copies that would be suitable for performing a point-in-time recovery. In the absence of any other criteria, RMAN selects the most current file copy or backup set to restore. See "untilClause".  

validate  

causes RMAN to decide which backup sets, datafile copies, and archived logs need to be restored and then scans them to verify their contents. This operation creates no output files. Specify this option periodically to verify that the copies and backup sets required to restore the specified files are intact and usable.  

check logical  

tests data and index blocks that pass physical corruption checks for logical corruption, e.g., 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, the command terminates without populating the views.

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

check readonly  

checks the datafiles to make sure they exist, are readable, and have the appropriate checkpoint. If any of these conditions is not met, then RMAN restores the files--whether or not they are read-only. By default, RMAN does not restore read-only files when you issue the restore database command.  

Examples

Restoring a Tablespace

This example takes a tablespace offline, restores it, then performs media recovery:

run {  
     # recover tablespace tbs_1 while the database is open  
     allocate channel ch1 type 'sbt_tape';  
     sql "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE" ; 
     restore tablespace tbs_1 ; 
     recover tablespace tbs_1 ;  
     sql "ALTER TABLESPACE tbs_1 ONLINE" ; 
     release channel ch1 ;  
} 
Restoring the Control File

This example restores the control file to its default location, replicates it to all CONTROL_FILES locations, and mounts the database:

startup nomount;
run { 
     allocate channel ch1 type 'sbt_tape'; 
     restore controlfile; 
     alter database mount; 
} 
Restoring the Database Using a Backup Control File

This example restores the control file to a new location, replicates it to all control file locations specified in the parameter file, and then mounts the control file in order to restore the database:

startup nomount;
run { 
     allocate channel ch1 type 'sbt_tape';
     restore controlfile to '/oracle/dbs/cf1.ctl';
     replicate controlfile from '/oracle/dbs/cf1.ctl';
     alter database mount;
     restore database;
}
Restoring Archived Redo Logs to a New Location

This example restores all archived redo logs to the /oracle/temp_restore directory:

run { 
      set archivelog destination to '/oracle/temp_restore';
      allocate channel ch1 type disk;
      restore archivelog all;
}

Related Topics

"allocate"

"recover"

"untilClause"




Prev

Top

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index