Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Performing User-Managed Media Recovery

Performing User-Managed Media Recovery



|Views: 55|Likes:
Published by api-3801159

More info:

Published by: api-3801159 on Oct 17, 2008
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





4Performing User-Managed Media
This chapter describes how to recover a database, and includes the following topics:
Performing User-Managed Media Recovery: Overview
Performing Complete User-Managed Media Recovery
Performing Incomplete User-Managed Media Recovery
Recovering a Database in NOARCHIVELOG Mode
Performing Media Recovery in Parallel
Opening the Database After User-Managed Media Recovery
Interrupting User-Managed Media Recovery
User-Managed Media Recovery Restrictions
Performing User-Managed Media Recovery:

During complete or incomplete media recovery, Oracle applies redo log files to the
datafiles during the roll forward phase of media recovery. Because changes to undo
segments are recorded in the online redo log, rolling forward regenerates the
corresponding undo segments. Rolling forward proceeds through as many redo log files
as necessary to bring the database forward in time.

If you do not use Recovery Manager (RMAN) to perform recovery, then you should use
the SQL*PlusRECOVER command. It is also possible to use the SQL statementALTER
DATABASE RECOVER, but it is highly recommended that you use the SQL*Plus RECOVER
command instead.
This section contains these topics:
Preconditions of Performing User-Managed Recovery
Applying Logs Automatically with the RECOVER Command
Recovering When Archived Logs Are in the Default Location
Recovering When Archived Logs Are in a Nondefault Location
Resetting the Archived Log Destination
Overriding the Archived Log Destination
Responding to Unsuccessful Application of Redo Logs
Preconditions of Performing User-Managed Recovery
To start any type of media recovery, you must adhere to the following restrictions:
You must have administrator privileges.
All recovery sessions must be compatible.
One session cannot start complete media recovery while another performs
incomplete media recovery.
You cannot start media recovery if you are connected to the database through a
shared server process.
Applying Logs Automatically with the RECOVER Command

Oracle Corporation recommends that you use the SQL*PlusRECOVER command rather than the ALTER DATABASE RECOVER statement to perform media recovery. In almost all cases, the SQL*Plus method is easier.

When using SQL*Plus to perform media recovery, the easiest strategy is to perform
automatic recovery. Automatic recovery initiates recovery without manually prompting
SQL*Plus to apply each individual archived log.

When using SQL*Plus, you have two options for automating the application of the
default filenames of archived redo logs needed during recovery:
Issuing SET AUTORECOVERY ON before issuing theRECOVER command
Specifying theAUTOMATIC keyword as an option of theRECOVER command
In either case, no interaction is required when you issue theRECOVER command if the
necessary files are in the correct locations with the correct names.

The filenames used when you use automatic recovery are derived from the concatenated values ofLOG_ARCHIVE_FORMAT withLOG_ARCHIVE_DEST_n, wheren is the highest value among all enabled, local destinations.

For example, assume the following initialization parameter settings are in effect in the
database instance:

LOG_ARCHIVE_DEST_1 = "LOCATION=/arc_dest/loc1/"
LOG_ARCHIVE_DEST_2 = "LOCATION=/arc_dest/loc2/"
LOG_ARCHIVE_FORMAT = arch_%t_%s.arc

In this case, SQL*Plus automatically suggests the filename
/arc_dest/loc2/arch_%t_%s.arc(where %t is the thread and %s is the sequence).
If you run SET AUTORECOVERY OFF, which is the default option, then you must enter the
filenames manually, or accept the suggested default filename by pressing the Enter key.
Using SET AUTORECOVERY for Automatic Recovery
Run the SET AUTORECOVERY ON command to enable on automatic recovery.
To automate the recovery using SET AUTORECOVERY:
1. Restore a backup of the offline datafiles. This example restores an inconsistent
backup of all datafiles using an operating system utility:
2. % cp /fs2/BACKUP/tbs* /oracle/dbs
4. Ensure the database is mounted. For example, if the database is shut down, run:
7. Enable automatic recovery. For example, in SQL*Plus run:
10. Recover the desired datafiles. This example recovers the whole database:
12.Oracle automatically suggests and applies the necessary archived logs, as in this
sample output:

ORA-00279: change 53577 generated at 01/26/00 19:20:58 needed for
thread 1
ORA-00289: suggestion : /oracle/work/arc_dest/arcr_1_802.arc
ORA-00280: change 53577 for thread 1 is in sequence #802
Log applied.
ORA-00279: change 53584 generated at 01/26/00 19:24:05 needed for
thread 1
ORA-00289: suggestion : /oracle/work/arc_dest/arcr_1_803.arc
ORA-00280: change 53584 for thread 1 is in sequence #803
ORA-00278: log file "/oracle/work/arc_dest/arcr_1_802.arc" no
longer needed for this
Log applied.
Media recovery complete.

13. Open the database. For example:
After issuing the ALTER DATABASE RECOVER statement, you can view all
files that have been considered for recovery in the
V$RECOVERY_FILE_STATUS view. You can access status information for
each file in theV$RECOVERY_STATUS view. These views are not
accessible after you terminate the recovery session.
Using RECOVERY AUTOMATIC for Automatic Recovery

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->