RelationalDBDesign RelationalDBDesign


Recovery File Structures   «Prev  Next»
Lesson 4 Control file maintenance
ObjectiveDescribe how to move and recreate control files.

Oracle Control file maintenance

This lesson reviews the basic maintenance activities performed to manage and maintain your control files.

Adding a second control file

You can add a control file to a database manually or through Instance Manager.
  1. Bring the database down.
  2. Copy your control file to another location.
  3. Edit your init.ora file so that the control_files entry references both control files.
  4. This might look like:
    control_files = (c:\oracle8\database\ctrlorc1.ora,
    d:\oracle8\database\ctrlorc1.ora)
    
  5. Bring your database back up.

To do this through instance manager is similar. In step 3, edit the instance parameter to reference the second control file, apply your changes, and restart your database. The following image illustrates instance manager.
Instance Manager
Instance Manager

Moving an existing control file entry

To move the file d:\oracle8\database\ctrlorc1.ora to e:\oracle8\database, do the following:
  1. Bring the database down.
  2. Copy your control file to another location.
  3. Edit you init.ora file so that the control_files entry references both control files.
  4. This might look like:
    control_files = (c:\oracle8\database\ctrlorc1.ora, 
    e:\oracle8\database\ctrlorc1.ora) 
    
  5. Move the file d:\oracle8\database\ctrlorc1.ora to e:\oracle8\database\ctrlorc1.ora.
  6. Bring your database back up.

To do this in instance manager is the same process. In step three modify the control_files entry in init.ora to point to the new location.

Building a new control file

Let us say the control file is damaged, Oracle cannot open your database, and you have planned for this occurrence. You can rebuild your control file assuming that you have run server manager and executed the following command:
svrmgr> alter database backup controlfile to trace
This will create a file in the directory specified by the user_dump_dest parameter with a name in the following format ora#####.trc. To see the output from a default Oracle 8.0.5 installation review the file ora00305.trc with any text editor, such as Notepad:

ora00305.trc
ora00305.trc

Just follow the directions and you will be back in business.
The next lesson is about the database redo log files.

Control File Maintenance - Exercise

Click the Exercise link below to complete a brief matching exercise.
Control File Maintenance - Exercise