RelationalDBDesign RelationalDBDesign


Catalog Maintenance   «Prev  Next»

Reset Oracle database

Steps to reset the Database

The steps in the simulation are as follows:
  1. Enter the command to determine the RMAN-supported incarnations of your databases. Type list incarnation of database at the prompt and press enter.
  2. Enter the command to reset the database ORC1, which is the database you are attached to, to its previous incarnation. Type reset database to incarnation 4 at the prompt and press enter.
  3. This completes the simulation.

Resetting the Database Incarnation in the Recovery Catalog

You create an incarnation of the database when you open the database with the RESETLOGS option. You can access a record of the new incarnation in the V$DATABASE_INCARNATION view. If you open the database with the RESETLOGS option, then a new database incarnation record is automatically created in the recovery catalog. The database also implicitly and automatically issues a RESET DATABASE command, which specifies that this new incarnation of the database is the current incarnation. All subsequent backups and log archiving done by the target database is associated with the new database incarnation. Whenever RMAN returns the database to an SCN before the current RESETLOGS SCN, using either RESTORE and RECOVER or FLASHBACK DATABASE, the RESET DATABASE TO INCARNATION command is required. However, you do not need to execute RESET DATABASE TO INCARNATION explicitly in the following scenarios because RMAN runs the command implicitly with Flashback.

  1. You use FLASHBACK DATABASE to rewind the database to an SCN in the direct ancestral path (see "Database Incarnations" on page 14-6 for an explanation of the direct ancestral path).
  2. You use FLASHBACK DATABASE to rewind the database to a restore point. The following procedure explains how to reset the database incarnation when recovering through a RESETLOGS.

To reset the recovery catalog to an older incarnation for media recovery:

1. Determine the incarnation key of the desired database incarnation. Obtain the incarnation key value by issuing a LIST command:
LIST INCARNATION OF DATABASE trgt;

The incarnation key is listed in the Inc Key column.

2. Reset the database to the old incarnation. For example, enter: RESET DATABASE TO INCARNATION 2;
3. If the control file of the previous incarnation is available and mounted, then skip to Step 6 of this procedure. Otherwise, shut down the database and start it without mounting.
For example:
SHUTDOWN IMMEDIATE
STARTUP NOMOUNT

4. Restore a control file from the old incarnation. If you have a control file tagged, then specify the tag. Otherwise, you can run the SET UNTIL command, as in this example:
RUN
{
SET UNTIL 'SYSDATE-45';
RESTORE CONTROLFILE; 
# only if current control file is not available
}

5. Mount the restored control file:
ALTER DATABASE MOUNT;
6. Run RESTORE and RECOVER commands to restore and recover the database files from the prior incarnation, then open the database with the RESETLOGS option. For example, enter:
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;