Oracle Control File Management


The control file provides the reference mapping between the physical structures of the database and the logical structures of the database. The control file is a storage location for the names and places of all physical datafiles for a database instance. Also included in the control files is all timestamp information which applies to data files. A database will not start up without atleast one functional control file. The CREATE CONTROLFILE command can be issued from a command line prompt within the Oracle Server Manager program. It is also possible to run the ALTER DATABASE command and create a control rebuild script. It is advisable to keep atleast two copies of the control file, even on separate disks, to avoid possible corruption or loss of a single disk drive. A control file which has been heavily altered over a long period of time could be very difficult if not impossible to recreate to its former state.

Oracle Corporation recommends that you have atleast two control files, placed on two different physical disks.

Make and keep secure copies of control files or generated control file recreation scripts and make these backup copies OFTEN !!! Complete loss of control files could mean VERY BIG TROUBLE for your databases.

Control File Contents

The control file is stored in binary form and contains the database name, names and locations of associated databases, names and locations of redo logs, database creation timestamp, the current log sequence number of the current online redo log file and checkpoint information.

Multiplexed Control Files

Multiplexing of control files means maintenance of multiple copies of online control files. Extra copies of the control file can be copied in the operating system or generated using the CREATE CONTROL FILE command. Then change the control_files parameter in the init.ora file to utilise all the control files created as shown below.

control_files = 
(
	 "c:\Oracle\ORADATA\<SID>\control01.ctl"
	,"c:\Oracle\ORADATA\<SID>\control02.ctl"
	,"d:\Oracle\ORADATA\<SID>\control01.ctl"
	,"d:\Oracle\ORADATA\<SID>\control02.ctl"
)

Note that the database MUST be shut down prior to copying control files. In the case of Windows NT shut down the SID service aswell. Note that if creating new control files with the CREATE CONTROL FILE command ensure to create any control files with exactly the same size, ie. parameter settings as the original. The original control file(s) can be obtained in text format by issuing the ALTER DATABASE BACKUP CONTROLFILE TO TRACE command and retrieving the ASCCII text form of the control file recreation script from the appropriate trace file.

Beware of the CREATE CONTROLFILE command. Use it very carefully. Ommissions of datafiles or redo logs can potentially cause irrepairable database damage.

Note that when issuing the CREATE CONTROLFILE command select the RESETLOGS option if any redo logs have been lost or damaged.

Datafiles in the database and not specified in the CREATE CONTROLFILE statement will be added into the control file as missing entries and denoted as MISSINGnnnn (nnn = filenumber). The missing datafile is set as being offline and in need of media recovery.

Control File Size

Control file size is determined by the settings of specific parameters used in the CREATE DATABASE command. These parameters are MAXDATAFILES, MAXLOGFILES, MAXLOGMEMBERS, MAXLOGHISTORY and MAXINSTANCES.