Controlfile DB Parameters   «Prev  Next»
Lesson 6 Re-creating control files
ObjectiveCreate a new control file from scratch.

Re-creating control files

If because of some catastrophic disk failure you lose all the control files for your database, you can still recover them as long as you have been faithful about backing up the control file to trace after each structural change. The trace file will have the necessary commands to create a new control file, restart, and recover your database.
The process for re-creating the database control file using the backup to trace looks like this:
  1. Make sure that the database is completely shut down.
  2. Back up all the database files.
  3. Edit the trace file, and remove all the messages preceding the STARTUP NOMOUNT command. Save the resulting file. You may want to change the extension from .trc to .sql.
  4. Start Server Manager and connect as the INTERNAL user.
  5. User Server Manager's @ command to execute the trace file.
When you execute the trace file, the first thing that happens is that the STARTUP NOMOUNT command starts up the Oracle instance. Next, a CREATE CONTROLFILE command is executed. The CREATE CONTROLFILE command is what actually re-creates your control files. The remaining commands in the trace file initiate recovery and then open the database.
View the code below to view the output from the entire process.
$svrmgrl

Oracle Server Manager Release 3.1.5.0.0 - Production

(c) Copyright 1997, Oracle Corporation.  All Rights Reserved.

Oracle8i Release 8.1.5.0.0 - Production

With the Partitioning and Java options

PL/SQL Release 8.1.5.0.0 - Production

SVRMGR> connect internal

Connected.

SVRMGR > @ora00241.sql

ORACLE instance started.

Total System Global Area                         34451404 bytes

Fixed Size                                          65484 bytes

Variable Size                                    17469440 bytes

Database Buffers                                 16384000 bytes

Redo Buffers                                       532480 bytes

Statement processed.

ORA-00283: recovery session canceled due to errors

ORA-00264: no recovery required

Statement processed.

SVRMGR >

There are other reasons to re-create a control file besides recovering from a disk failure. If you have moved database files to new locations, re-creating the control file is one way to tell Oracle about that. You can also re-create the control file to make it larger. For example, you may want to increase the MAXDATAFILES or MAXLOGFILES limits. Re-creating the control file allows you to do that.
In the next lesson, you will learn how to check current database parameter settings.

Recreating Control Files - Quiz

Click the Quiz link below to answer a few questions about re-creating control files.
Recreating Control Files - Quiz