What Are Control Files?


The control file is a binary file that defines the current state of the physical database. The control file is one of the core files at the heart of the Oracle database. Together, this means that the Oracle instance itself is the only means by which the contents of the control file should ever be modified. The DBA should only modify it indirectly by means of altering the database. Loss or corruption of the control file requires a database recovery.

The control file is read at the mount stage of database startup and is required for the database to be functional. Each control file is linked to a single database. Before the database is opened, Oracle reads the control file to determine whether the database is in a valid state to use. The control file is updated almost continuously by the Oracle server when the database is in use and therefore must be available for write processing whenever the database is open.

The control file should be multiplexed (multiple identical copies located in multiple locations, preferably on different disks, hard drives, or other devices) or at least duplexed (two identical copies located in two different locations, preferably on different disks, hard drives, or other devices), because it maintains the integrity of the database, and loss of a single control file could mean significant downtime and loss of productivity in the database. If for any reason the control file is not accessible when the database is open, the database will not function properly. If all the copies of the database's control files are lost, the database must be recovered before it can be opened.

Although the control file doesn't have to be multiplexed, and it is suggested that it be at least duplexed, it is possible that they be multiplexed up to a maximum of eight times.


The initial size of the control file is determined when the database is first created. The keywords, during database creation, that affect the initial size of the control file are the following:

  • MAXLOGFILES

  • MAXLOGMEMBERS

  • MAXLOGHISTORY

  • MAXDATAFILES

  • MAXINSTANCES

Uses of the Control Files

Every time you start up an instance of Oracle, the control file is read and used to identify the database and redo log files that need to be opened for database operation to successfully proceed.

Every time the physical characteristics of the database are altered (every time a new data file is added to a tablespace, a new tablespace is added to the database, or a new redo log file is created), Oracle writes this information to the control file so it can retrieve that information later, when it is needed.

Oracle also uses the control file to support the Recovery Manager (RMAN) feature. RMAN stores metadata about its operations in the control file for the database that it is operating on, if you choose to not use the recovery catalog schema for this purpose.

More information on RMAN and its options will be needed when you prepare for the Oracle 9i Fundamentals 2 exam and is covered in Oracle DBA Fundamentals II test preparation.

Information on preparing for this exam can be found in the OCP Oracle9i Database: Fundamentals II Exam Guide, Rama Velpuri, Osborne, ISBN: 0072195436.


Contents of the Control Files

The control file contains the database name and identifier for the database to which it is associated. This database name is taken either from the name specified by the initialization parameter DB_NAME or the name used in the CREATE DATABASE statement. The database identifier is recorded in the control file when the database is created.

The RESETLOGS SCN and associated time stamp are also found in the control file. The SCN is the system change number and is stored in every data file and in the control files and log files. Together with the RESETLOGS time stamp, the RESETLOGS SCN is the unique identifier for the execution time of the last ALTER DATABASE OPEN RESETLOGS statement. Whenever you enter the RESETLOGS parameter for the ALTER DATABASE OPEN statement, Oracle creates a new incarnation of the database.

An incarnation is a separate version of the physical database. This means that you now would have to restore from a cold backup because you can't easily restore the database to the state that it was in immediately before the RESETLOGS command. You should make a whole database backup after you issue the RESETLOGS command.


The RESETLOGS SCN and RESETLOGS time stamps are stored in the control file and in the header of each data file in the database, and in each redo log file header in the database. An online log or an archived redo log cannot be applied in a recovery if its RESETLOGS data does not exactly match the database and RESETLOGS information in the control file.

There are only a few special circumstances where a data file can be recovered if its RESETLOGS information does not match that of the control file. These include offline normal tablespaces or read-only tablespaces.

The control file contains the time stamp of database creation (recorded at the time when the CREATE DATABASE script is run), tablespace names for every tablespace in the database, and the names and locations of all data files and redo log files. These names and locations are updated whenever a data file or redo log file is added to, renamed in, or dropped from the associated database. Tablespace information is updated whenever a tablespace is either added to the database or dropped from the database.

The control file contains the current redo log file sequence number, redo log archiving information, and checkpoint information. Redo log history is recorded during log switch operations. Locations and statuses of archived redo logs are recorded whenever archiving occurs in the instance. Current log sequence numbers are recorded in the control file when log switches occur, and checkpoint information is recorded as checkpoints are made in the database.

Furthermore, the control file contains the beginning and ending of undo segments and relevant backup information. Locations and statuses of backups are recorded by the RMAN utility if an RMAN recovery catalog is not used.

The control file consists of two types of sections: reusable and not reusable.

Reusable Sections

Reusable sections of the control file store recovery manager information, such as backup data filenames and backup redo log filenames. These names are circular in nature, meaning that they can be reused and recycled when necessary, but only by the RMAN utility.

More on the RMAN utility is provided in Oracle DBA Fundamentals II test preparation.

Information on preparing for this exam can be found in the OCP Oracle9i Database: Fundamentals II Exam Guide, Rama Velpuri, Osborne, ISBN: 0072195436.


Nonreusable Sections

The nonreusable portion of the control file is where information about data file, tablespace, and redo thread records (for example) are stored, along with any other information that never gets reused. These nonreusable entries are, of course, nonreusable unless the corresponding object is dropped from the database.

A control file contains all the information about its associated database that is or will be required for access of that database by an instance, both at startup time and during normal operations. It is information that has to be altered indirectly by Oracle; no database administrator or user can edit a control file.




    Oracle 9i Fundamentals I Exam Cram 2
    Oracle 9i Fundamentals I Exam Cram 2
    ISBN: 0789732653
    EAN: 2147483647
    Year: 2004
    Pages: 244
    Authors: April Wells

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net