Oracle9i Recovery Manager Reference Release 1 (9.0.1) Part Number A90136-02 |
|
RMAN Commands , 47 of 60
restoreObject::=
restoreSpecOperand::=
To restore files from backups or image copies. By default, RMAN restores files to their default location. You can use the SET
NEWNAME
command to restore files to nondefault locations. RMAN restores backups from disk or tape and restores images copies from disk only.
Typically, you restore when a media failure has damaged a current datafile, control file, or archived log or prior to performing a point-in-time recovery. The RESTORE
command restores full backups, incremental backups (level 0 only), or copies of datafiles, control files, and archived redo logs. Because the RECOVER
command automatically restores archived logs as needed, you should seldom need to restore logs manually. Possible reasons for manually restoring archived logs are to speed up recovery or to stage the logs to multiple destinations.
When you perform a restore operation by using a backup control file and use a recovery catalog, RMAN automatically adjusts the control file to reflect the structure of the restored database.
If you restore to the default location, then RMAN overwrites files with the same filenames. If you restore to a new location, then issue SET
NEWNAME
commands to rename the files and issue a SWITCH
command to make the restored files current. If you do not issue SWITCH
commands, then RMAN considers the restored files as valid copies for use in future restore operations.
If you do not manually allocate channels, then RMAN allocates all automatic channels possibly needed by the RESTORE
command. For example, assume you configure 3 separate sbt
channels (each with different PARMS
) and then configure parallelism for DISK
and sbt
as follows:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2; CONFIGURE DEVICE TYPE sbt PARALLELISM 3; CONFIGURE DEFAULT DEVICE TYPE TO sbt;
During a restore, RMAN allocates three sbt
channels and the two preconfigured DISK
channels. For a restore, RMAN allocates all configured channels unless the DEVICE
TYPE
option restricts the device type from which RMAN restores files.
SET
NEWNAME
commands to rename the datafiles and use
SWITCH
commands to make them the current database files. If you do not use SWITCH
, then the repository lists the restored datafile as a datafile copy.
FROM
DATAFILECOPY
option, then the allocated channels must be of DEVICE
TYPE
DISK
.
FROM
BACKUPSET
operand, then the appropriate type of storage devices must be allocated for the backup sets that need to be restored. If the appropriate device is not allocated, then you may not be able to find a candidate backup set or copy to restore, and the RESTORE
command fails.
RESTORE
command.
For example, if you made some backups of a datafile to DISK
channels and others to sbt
channels, and only a DISK
channel is allocated for the RESTORE
command, RMAN will not restore backups that were created on sbt
channels.
RESTORE
a datafile without first re-creating the symbolic link, then RMAN restores the datafile to the location of the link file rather than to the location pointed to by the link.
RESETLOGS
after restoring with a backup control file.
datafile 1
is both specified explicitly and implied by the SYSTEM
tablespace:
RESTORE TABLESPACE SYSTEM DATAFILE 1;
TO
'filename', then the database must be started but not mounted. RMAN restores the control file to the first location specified in the parameter file and then replicates it to all other locations. When the database is not mounted, you must set the DBID using the
SET
command or the restore fails. If you specify the TO
'filename' option, then RMAN only restores the control file to the specified location. In this case, you do not need to set the DBID because RMAN takes the value from the control file.
CONFIGURE
(except for DISK
, which is preconfigured) before specifying the DEVICE
TYPE
option.
RECOVER
with the DEVICE
TYPE
option.
restoreObject |
Specifies the objects to be restored. |
|
|
|
Restores the current control file to the default location and automatically replicates it to all
If you specify a new path name with the
Note that you must always run the |
|
|
Restores all datafiles in the database except those that are offline or read-only. Unlike
If you specify the
Use an optional
If you specify |
|
Restores the datafiles specified by filename or absolute datafile number. See Also: "datafileSpec" |
|
|
|
Restores all datafiles in the specified tablespaces. |
|
archivelogRecordSpecifier |
Restores the specified range of archived redo logs. See Also: "archivelogRecordSpecifier" Note: The database can be started, mounted, or open for this operation. |
restoreSpecOperand |
specifies options for the restoreObject clause.
Note: These parameters override the parameters with the same name at the |
|
|
|
Specifies the case-sensitive name of a channel to use for this restore operation. If you do not specify a channel, then |
|
|
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 were created with the specified tag. If multiple backup sets or file copies have a matching tag, then RMAN selects the most recent one. |
|
|
Specifies a quoted string containing operating system-specific information. The string is passed to the operating system dependent layer each time a backup piece is restored. |
|
|
Restores a control file autobackup. You can only specify this option on the Note these restrictions when restoring an autobackup:
|
|
|
Specifies the name of the backup piece containing a control file backup. The media_handle can be any backup piece that contains a backup of a control file: the control file backup does not need to be an autobackup. Refer to the |
|
Refer to the restoreSpecOperand clause. |
|
|
Refer to the restoreSpecOperand clause. |
|
|
Specifies whether RMAN should restore from a |
|
Limits the selection to those backup sets or file copies that would be suitable for performing an incomplete recovery to the specified time. In the absence of any other criteria, RMAN selects the most current file copy or backup set to restore. See Also: "untilClause" |
||
|
Refer to the restoreSpecOperand clause. |
|
|
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. |
|
|
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
If the sum of physical and logical corruptions for a file remain below its
Note: The |
|
|
Checks the read-only 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 |
|
Allocates automatic channels for the specified device type only. For example, if you configure automatic disk and tape channels, and issue See Also: "deviceSpecifier" |
||
|
Overrides the restartable restore feature and restores all files regardless of whether they need to be restored. If you do not specify |
This example takes a tablespace offline, restores it, then performs media recovery:
SQL "ALTER TABLESPACE TBS_1 OFFLINE IMMEDIATE"; RESTORE TABLESPACE tbs_1; RECOVER TABLESPACE tbs_1; SQL "ALTER TABLESPACE TBS_1 ONLINE";
This example restores the control file to its default location, replicates it to all multiplexed locations, and mounts the database:
RUN { STARTUP FORCE NOMOUNT; RESTORE CONTROLFILE; ALTER DATABASE MOUNT; }
This example restores the control file specified by a tag, replicates it, and then mounts the database:
STARTUP NOMOUNT; RESTORE CONTROLFILE FROM TAG 'monday_cf_backup'; ALTER DATABASE MOUNT;
This example restores the control file, 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 c1 DEVICE TYPE sbt; RESTORE CONTROLFILE; ALTER DATABASE MOUNT; RESTORE DATABASE; }
This example restores all archived redo logs to the /oracle/temp_restore
directory:
RUN { SET ARCHIVELOG DESTINATION TO '/oracle/temp_restore'; RESTORE ARCHIVELOG ALL; }
This example restores the latest control file autobackup made on or before June 23, 2000 with a nondefault format of PROD_CF_AUTOBACKUP_%F
. It starts searching for backups with a sequence number of 20, and searches backwards for 5 months:
RUN { SET UNTIL TIME '23-JUN-2000 00:00:00'; SET CONTROLFILE AUTOBACKUP FORMAT TO 'PROD_CF_AUTOBACKUP_%F'; ALLOCATE CHANNEL CHANNEL_1 DEVICE TYPE sbt; RESTORE CONTROLFILE TO '/tmp/autobackup_20001002.dbf' FROM AUTOBACKUP MAXSEQ 20 MAXDAYS 150; }
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|