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

Performing User-Managed Media Recovery

Ratings:

4.5

(4)
|Views: 55|Likes:
Published by api-3801159

More info:

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

Availability:

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

05/09/2014

pdf

text

original

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

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:
\u2022
Preconditions of Performing User-Managed Recovery
\u2022
Applying Logs Automatically with the RECOVER Command
\u2022
Recovering When Archived Logs Are in the Default Location
\u2022
Recovering When Archived Logs Are in a Nondefault Location
\u2022
Resetting the Archived Log Destination
\u2022
Overriding the Archived Log Destination
\u2022
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:
\u2022
You must have administrator privileges.
\u2022
All recovery sessions must be compatible.
\u2022
One session cannot start complete media recovery while another performs
incomplete media recovery.
\u2022
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:
\u2022
Issuing SET AUTORECOVERY ON before issuing theRECOVER command
\u2022
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_DEST_STATE_1 = DEFER
LOG_ARCHIVE_DEST_STATE_2 = ENABLE
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
3.
4. Ensure the database is mounted. For example, if the database is shut down, run:
5. STARTUP MOUNT
6.
7. Enable automatic recovery. For example, in SQL*Plus run:
8. SET AUTORECOVERY ON
9.
10. Recover the desired datafiles. This example recovers the whole database:
11.RECOVER 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
recovery
Log applied.
Media recovery complete.

13. Open the database. For example:
14.ALTER DATABASE OPEN;
Note:
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

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