Database Reference
In-Depth Information
7.
Continue to attempt to apply each online redo log group until you find the correct log
sequence number.
Once the final online redo log is applied, recovery will complete automatically and
without error.
8.
You can now open the database using the
ALTER DATABASE OPEN RESETLOGS
command.
Recovering Lost Control Files Using the
CREATE CONTROLFILE
Command
In Chapter 1, we introduced the
ALTER DATABASE BACKUP CONTROLFILE TO TRACE
command.
This created a trace file that you can use to recreate your control file. If you lose your control
files, a backup control file is the easiest way to manually recover. However, if you do not have
a backup control file, you have two options:
■■
Use the contents of the script created as a result of the
ALTER DATABASE BACKUP
CONTROLFILE TO TRACE
command.
■
Manually issue the
CREATE CONTROLFILE
command.
As already discussed in Chapter 1, the
ALTER DATABASE BACKUP CONTROLFILE TO TRACE
command creates a script that you can use to recover your control file. The script will need
to be modified before it can be used.
The script contains the following sections:
■
Trace-file header
■
List of parameters related to archiving
■
NORESETLOGS
case for recreating the control file
■
RESETLOGS
case for recreating the control file
As you can see, the script has two different versions of the
CREATE CONTROLFILE
command.
One is for recoveries where the online redo logs are intact. You will want to edit the script so
that the correct type of recovery is done. Each version of the script also contains code to regis-
ter archived redo logs, recover the database, and then open the database automatically.
Let's look at the following code, which is an example of using the
NORESETLOGS
case.
The script is designed to do it all without any DBA interference. First, it starts the database
instance. It then proceeds to issue the
CREATE CONTROLFILE
command. The script records
some archived redo log records in the control file that will be needed for recovery. The data-
base is then recovered and opened. Finally, the temporary tablespace tempfile is recreated.
You may want to use the RMAN Catalog command to catalog all of the backup sets after
this recovery, since the RMAN metadata will be missing from the control file.
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
Search WWH ::
Custom Search