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:
- Make sure that the database is completely shut down.
- Back up all the database files.
- 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.
- Start Server Manager and connect as the
INTERNAL
user.
- 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.
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.