Oracle7 Server SQL Reference

Contents Index Home Previous Next

RECOVER clause

Purpose

To perform media recovery.

Prerequisites

The RECOVER clause must appear in an ALTER DATABASE statement. You must have the privileges necessary to issue this statement. For information on these privileges, see the ALTER DATABASE command [*].

You must also have the OSDBA role enabled. You cannot be connected to Oracle7 through the multi-threaded server architecture. Your instance must have the database mounted in exclusive mode.

Note: It is recommended that you perform media recovery using Server Manager rather than using the ALTER DATABASE command with the RECOVER clause.

Syntax

Keywords and Parameters

AUTOMATIC

automatically generates the names of the redo log files to apply during media recovery. If you omit this option, then you must specify the names of redo log files using the ALTER DATABASE ... RECOVER command with the LOGFILE clause.

FROM

specifies the location from which the archived redo log file group is read. The value of this parameter must be a fully-specified file location following the conventions of your operating system. If you omit this parameter, Oracle7 assumes the archived redo log file group is in the location specified by the initialization parameter LOG_ARCHIVE_DEST.

STANDBY

recovers the standby database using the controlfile and archived redo log files copied over from the primary database. For more information, see the Oracle7 Server Administrator's Guide.

DATABASE

recovers the entire database. This is the default option. You can only use this option when the database is closed.

UNTIL CANCEL

performs cancel-based recovery. This option recovers the database until you issue the ALTER DATABASE RECOVER command with the CANCEL clause.

UNTIL TIME

performs time-based recovery. This parameter recovers the database to the time specified by the date. The date must be a character literal in the format 'YYYY-MM-DD:HH24:MI:SS'.

UNTIL CHANGE

performs change-based recovery. This parameter recovers the database to a transaction consistent state immediately before the system change number (SCN) specified by integer.

USING BACKUP CONTROLFILE

specifies that a backup control file is being used instead of the current control file.

TABLESPACE

recovers only the specified tablespaces. You can use this option if the database is open or closed, provided the tablespaces to be recovered are offline.

DATAFILE

recovers the specified data files. You can use this option when the database is open or closed, provided the data files to be recovered are offline.

LOGFILE

continues media recovery by applying the specified redo log file.

CONTINUE

continues multi-instance recovery after it has been interrupted to disable a thread.

CONTINUE DEFAULT

continues recovery by applying the redo log file that Oracle7 has automatically generated.

CANCEL

terminates cancel-based recovery.

PARALLEL

specifies degree of parallelism to use when recovering. See parallel_clause [*].

Usage Notes

It is recommended that you use the Server Manager RECOVER command rather than the ALTER DATABASE command with the RECOVER clause to perform media recovery.

For most purposes, the RECOVER Server Manager command is easier to use than the ALTER DATABASE command. For information on this command, see Oracle Server Manager User's Guide.

For more information on media recovery, see the "Recovering a Database" chapter of Oracle7 Server Administrator's Guide.

You can use the ALTER DATABASE command with the RECOVER clause if you want to write your own specialized media recovery application using SQL.

Example I

The following statement performs complete recovery of the entire database:

ALTER DATABASE 
	RECOVER AUTOMATIC DATABASE 

Oracle7 automatically generates the names of redo log files to apply and prompts you with them. The following statement applies a suggested file:

ALTER DATABASE 
	RECOVER CONTINUE DEFAULT 

The following statement explicitly names a redo log file for Oracle7 to apply:

ALTER DATABASE 
	RECOVER LOGFILE 'diska:arch0006.arc' 

Example II

The following statement performs time-based recovery of the database:

ALTER DATABASE AUTOMATIC 
	RECOVER UNTIL TIME '1992-10-27:14:00:00' 

Oracle7 recovers the database until 2:00pm on October 27, 1992.

Example III

The following statement recovers the tablespace USER5:

ALTER DATABASE 
	RECOVER TABLESPACE user5 

Related Topics

ALTER DATABASE command [*]


Contents Index Home Previous Next