Database Architecture   «Prev  Next»

Lesson 4 The Control File
Objective Understand the purpose, structure, and redundancy requirements of Oracle database control files.

Oracle Database Control File Information

Every Oracle database contains at least one control file[1]. The control file stores critical metadata about the database’s physical structure, including:
  1. Database name
  2. Tablespace information
  3. Names and locations of all datafiles
  4. Names and locations of all redo log files
  5. The current log sequence number
  6. Checkpoint information
  7. Archiving status of redo logs

Main Function of the Control File

The control file functions as the roadmap of the database. When an instance starts, Oracle:
  1. Reads the initialization parameter file to locate the control files.
  2. Uses the control files to identify all datafiles and redo log files.
  3. Opens those files to make the database available for use.
Without the control file, Oracle cannot mount or open the database.

Importance of the Control File

Because of its critical role, Oracle strongly recommends maintaining at least three copies of the control file. These should reside on different physical disks and, ideally, different controllers.

Control files are always kept synchronized: Oracle writes the same information to each copy simultaneously. The initialization parameter file (init.ora or spfile.ora) defines the control file locations to ensure redundancy.

Data in Control Files and Initialization Files

Data stored in control files and initialization files
  • Database name: stored in both control and initialization files.
  • Names and locations of datafiles: stored in control files.
  • Names and locations of control files: defined in initialization files.
  • Current log sequence number: maintained in control files.
  • Database block size: specified in initialization files.
  • Shared pool size: specified in initialization files.

Specifying Control Files

A database should maintain at least two copies of the control file on separate disks. Without a valid copy, Oracle risks losing track of the database structure. Although it is possible to rebuild a control file, the process is complex and should be avoided through redundancy.

Control file locations are defined with the CONTROL_FILES initialization parameter:

control_files = (/u00/oradata/control01.dbf,
                 /u01/oradata/control02.dbf,
                 /u02/oradata/control03.dbf)
Oracle updates all copies simultaneously to keep them consistent. If no value is specified, Oracle either uses a default name or relies on Oracle Managed Files (if enabled). Even when using redundant disk storage solutions like RAID, Oracle still recommends multiplexing control files across different devices for maximum protection.

Role in Database Operations

The control file includes:
  1. Database name
  2. Names and locations of datafiles and redo log files
  3. Timestamp of database creation
Control files support multiplexing (simultaneous identical copies) to guard against corruption or hardware failure. They are automatically updated whenever the physical structure changes, such as when adding a datafile or redo log. Control files are also indispensable during database recovery, providing information needed for Oracle to restore consistency after a failure.
Control files track the current log sequence number being written by the Log Writer (LGWR) process. During recovery, the control file guides Oracle in progressing through redo logs to restore the database to a consistent state.
[1] Control file: A binary file containing essential metadata that defines the physical structure of an Oracle database.

SEMrush Software 4 SEMrush Banner 4