RelationalDBDesign RelationalDBDesign


Backup Options   «Prev 

NOARCHIVELOG Database Recovery Steps

  1. To connect as sysdba, type CONNECT INTERNAL at the prompt and press Enter.
  2. Type ORACLE at the prompt and press Enter.
  3. To shut down the database, type SHUTDOWN ABORT at the prompt and press Enter.
  4. To access the operating system, type HOST at the prompt and press Enter.
  5. To copy the backup files to the directory where the original files are located, type COPY C:\DIGITAL\BACKUP\*.* C:\ORANT\DATABASE\ at the prompt and press Enter.
  6. To reenter Server Manager, type EXIT at the prompt and press Enter.
  7. To start the Oracle instance, type STARTUP OPEN PFILE=C:\ORANT\DATABASE\INITORCL.ORA at the prompt and press Enter.
  8. You have now successfully restored the database. This is the end of the Simulation.

Recovering to a Previous Incarnation

Problem: You experience a media failure immediately following an open resetlogs command. For example, you’re faced with
this scenario:
  1. You have recently performed an incomplete recovery and opened your database with the open resetlogs command.
  2. Before you can take another backup, you experience a media failure. You determine that you need to restore and recover the database to a point in time prior to the time you opened the database with the open resetlogs command.
  3. You initiate a point in time recovery prior to the time the database was opened with the open resetlogs command:

RMAN > restore database until time
"to_date('28-aug-2012 08:22:00','dd-mon-rrrr hh24:mi:ss')";
When restoring datafiles, the prior command throws this error:
RMAN-03002: failure of restore command at ...
RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time

In this situation you must restore and recover to a previous incarnation of your database.
Solution: Before starting, ensure that you set the NLS_DATE_FORMAT variable so that you can see the time component in RMAN’s output:
$ export NLS_DATE_FORMAT="DD-MON-RRRR HH24:MI:SS"

This will allow you to see the time component in RMAN’s output.
Step 1: Run the List Incarnation Command
You have to restore a control file that knows about the incarnation of the database to which you want to restore. Therefore, you first need to determine which incarnation you will be restoring to. Run the following command to display incarnation information:
RMAN > list incarnation;
Here is the sample output.
For this example, we want to restore to the time of 8:22 (which would be incarnation 14, which is prior to the current incarnation of 15).

Step 2: Shut Down the Database
RMAN > shutdown immediate;

Step 3: Start the Database in Nomount Mode
If you are not using a recovery catalog, start up this way:
RMAN > startup nomount;

If you are using a recovery catalog, use this command:
RMAN > startup force nomount;

Step 4: Restore the Control File to the Desired Time
This example assumes the use of an FRA and the auto backup of the control file is enabled:
RMAN> restore controlfile from autobackup until time
"to_date('28-aug-2012 08:22:00','dd-mon-rrrr hh24:mi:ss')";

If you are not using an FRA and the auto backup of the control file, see Chapter 10 for details on restoring the control file.
Step 5: Mount the Database
RMAN > alter database mount;

Step 6: Set the Database to the Desired Incarnation
From the output in step 1, for this scenario 14 is the desired incarnation.
RMAN > reset database to incarnation 14;

Step 7: Restore and Recover the Database
Now restore and recover the database to the same time as you specified when restoring the control file:
RMAN> restore database until time
"to_date('28-aug-2012 08:22:00','dd-mon-rrrr hh24:mi:ss')";
RMAN> recover database until time
"to_date('28-aug-2012 08:22:00','dd-mon-rrrr hh24:mi:ss')";
RMAN> alter database open resetlogs;

When successful, you should see this message:
Statement processed

Note Y ou can restore until a time, SCN, sequence, or restore point. ]-->