SQL*Plus User's Guide and Reference Release 8.1.6 A75664-01 |
|
Command Reference, 34 of 52
Performs media recovery on one or more tablespaces, one or more datafiles, or the entire database.
RECOVER {general | managed} [parallel]
where the general clause has the following syntax:
[AUTOMATIC] [FROM location] {[STANDBY] DATABASE [ [UNTIL {CANCEL | CHANGE integer | TIME date} | USING BACKUP CONTROLFILE]...] | STANDBY {DATAFILE datafilename [, DATAFILE datafilename...] | TABLESPACE tablespace [, TABLESPACE tablespace ...]} UNTIL [CONSISTENT] [WITH] CONTROLFILE | TABLESPACE tablespace [, tablespace ...] | DATAFILE datafilename [, datafilename ...] | LOGFILE filename | CONTINUE [DEFAULT] | CANCEL}
and where the managed clause has the following syntax:
MANAGED STANDBY DATABASE {TIMEOUT integer | CANCEL [IMMEDIATE]}
and where the parallel clause has the following syntax:
PARALLEL [integer] | NOPARALLEL
Refer to the following list for a description of each term and clause:
AUTOMATIC
Automatically generates the name of the next archived redo log file needed to continue the recovery operation. Oracle uses the LOG_ARCHIVE_DEST (or LOG_ARCHIVE_DEST_1) and LOG_ARCHIVE_FORMAT parameters (or their defaults) to generate the target redo log filename. If the file is found, the redo contained in that file is applied. If the file is not found, SQL*Plus prompts you for a filename, displaying a generated filename as a suggestion.
If you specify neither AUTOMATIC nor LOGFILE, SQL*Plus prompts you for a filename, displaying the generated filename as a suggestion. You can then accept the generated filename or replace it with a fully qualified filename. If you know the archived filename differs from what Oracle would generate, you can save time by using the LOGFILE clause.
FROM
location
Specifies the location from which the archived redo log file group is read. The value of location must be a fully specified file location following the conventions of your operating system. If you omit this parameter, SQL*Plus assumes the archived redo log file group is in the location specified by the initialization parameter LOG_ARCHIVE_DEST or LOG_ARCHIVE_DEST_1.
STANDBY
DATABASE
UNTIL CANCEL
UNTIL CHANGE
integer
UNTIL TIME
date
'YYYY-MM-DD:HH24:MI:SS'
USING BACKUP CONTROLFILE
STANDBY {[DATAFILE
datafilename
[, DATAFILE
datafilename
...]}
STANDBY {TABLESPACE
tablespace
[, TABLESPACE
tablespace
...]}
UNTIL [CONSISTENT] [WITH] CONTROLFILE
TABLESPACE
tablespace
DATAFILE
datafilename
LOGFILE
filename
CONTINUE [DEFAULT]
Continues multi-instance recovery after it has been interrupted to disable a thread.
Continues recovery using the redo log file that Oracle would automatically generate if no other logfile were specified. This option is equivalent to specifying AUTOMATIC, except that Oracle does not prompt for a filename.
CANCEL
MANAGED STANDBY DATABASE
Specifies sustained standby recovery mode. This mode assumes that the standby database is an active component of an overall standby database architecture. A primary database actively archives its redo log files to the standby site. As these archived redo logs arrive at the standby site, they become available for use by a managed standby recovery operation. Sustained standby recovery is restricted to media recovery.
For more information on the parameters of this clause, see the Oracle8i Backup and Recovery Guide.
TIMEOUT
integer
Specifies in minutes the wait period of the sustained recovery operation. The recovery process waits for integer minutes for a requested archived log redo to be available for writing to the standby database. If the redo log file does not become available within that time, the recovery process terminates with an error message. You can then issue the statement again to return to sustained standby recovery mode.
If you do not specify this clause, the database remains in sustained standby recovery mode until you reissue the statement with the RECOVER CANCEL clause or until instance shutdown or failure.
CANCEL [IMMEDIATE]
PARALLEL [
integer]
Causes Oracle to select a degree of parallelism equal to the number of CPUs available on all participating instances times the value of the PARALLEL_THREADS_PER_CPU initialization parameter.
The PARALLEL keyword overrides the RECOVERY_PARALLELISM initialization parameter. For more information about the PARALLEL keyword see the Oracle8i Parallel Server Concepts and Administration manual.
Use integer to specify the degree of parallelism, which is the number of parallel threads used in the parallel operation. Each parallel thread may use one or two parallel execution processes. Normally Oracle calculates the optimum degree of parallelism, so it is not necessary for you to specify integer.
You must be connected to Oracle as SYSOPER, or SYSDBA.
You cannot use the RECOVER command when connected via the multi-threaded server.
To perform media recovery on an entire database (all tablespaces), the database must be mounted EXCLUSIVE and closed.
To perform media recovery on a tablespace, the database must be mounted and open, and the tablespace must be offline.
To perform media recovery on a datafile, the database can remain open and mounted with the damaged datafiles offline (unless the file is part of the SYSTEM tablespace).
Before using the RECOVER command you must have restored copies of the damaged datafile(s) from a previous backup. Be sure you can access all archived and online redo log files dating back to when that backup was made.
When another log file is required during recovery, a prompt suggests the names of files that are needed. The name is derived from the values specified in the initialization parameters LOG_ARCHIVE_DEST and LOG_ARCHIVE_FORMAT. You should restore copies of the archived redo log files needed for recovery to the destination specified in LOG_ARCHIVE_DEST, if necessary. You can override the initialization parameters by setting the LOGSOURCE variable with the SET LOGSOURCE command.
During recovery you can accept the suggested log name by pressing return, cancel recovery by entering CANCEL instead of a log name, or enter AUTO at the prompt for automatic file selection without further prompting.
If you have enabled autorecovery (that is, SET AUTORECOVERY ON), recovery proceeds without prompting you with filenames. Status messages are displayed when each log file is applied.
When normal media recovery is done, a completion status is returned.
For more information on recovery and the RECOVER command, see the Oracle8i Administrator's Guide, and the Oracle8i Backup and Recovery guide.
To recover the entire database, enter
SQL> RECOVER DATABASE
To recover the database until a specified time, enter
SQL> RECOVER DATABASE UNTIL TIME 23-NOV-99:04:32:00
To recover the two tablespaces ts_one and ts_two from the database, enter
SQL> RECOVER TABLESPACE ts_one, ts_two
To recover the datafile data1.db from the database, enter
SQL> RECOVER DATAFILE 'data1.db'
|
![]() Copyright © 1999 Oracle Corporation. All Rights Reserved. |
|