Oracle8i Recovery Manager User's Guide and Reference
Release 2 (8.1.6)

Part Number A76990-01

Library

Product

Contents

Index

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

Recovery Manager Command Syntax, 37 of 50


restore

Syntax


restoreObject::=

restoreSpecOperand::=

Purpose

To restore files from backups or image copies to the current location, overwriting the files with the same name. You can use set newname command to restore files to non-default locations. RMAN restores backups from disk or tape and restores images copies from disk only.

RMAN considers restored files as datafile copies. If you restore to the default location, RMAN creates records for the datafile copies in the repository and immediately updates them to status DELETED. If you restore to a new location, issue set newname commands to rename the files, and issue a switch command to make the restored files current, RMAN also updates the records to DELETED. If you do not issue switch commands, then RMAN considers the restored files as valid copies for use in future restore operations.

Typically, you restore when a media failure has damaged a current datafile, control file, or archived redo log or prior to performing a point-in-time recovery. This command restores full backups, incremental backups (level 0 only), or copies of:

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:

Chapter 6, "Restoring and Recovering with Recovery Manager" to learn how to restore files. 

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. Unlike backup database, restore database does not automatically include the control file--you must issue an additional restore command to perform this operation.

If you specify the check readonly option, then RMAN examines the headers of all read-only files and restores any that need restoring.

Use an optional skip ... tablespace argument to avoid restoring specified 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 operating system-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, that is, 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, 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, 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 Control File Using a Tag

This example restores the control file specified by a tag, replicates it to all CONTROL_FILES locations, and then mounts the database:

startup nomount;
run { 
     allocate channel ch1 type 'sbt_tape'; 
     restore controlfile from tag 'monday_cf_backup'; 
     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"


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

All Rights Reserved.

Library

Product

Contents

Index