Control file Management

Source: Internet
Author: User

Control files are a very important file in the Oracle database.

In the Oracle database, mainly include: Data files, control files, and redo log files.
Stores data from a database in a data file, including various database objects and their data.
Holds records of the user executing DML and DDL commands in the Redo log file.

The structure information of the database is stored in the control file.
Specifically, the following important information is included in the control file:
• The name of the database.
• The location and name of the data file and redo log file.
. The current log sequence number.
• Checkpoint information.
• The name of the tablespace.
Backup and recovery information for Rman.
The control file is a binary file that the user cannot modify and view the contents of this file.

The database server needs to read the contents of this file at startup to open the database.
In order to understand the importance of the control file, we first introduce the database server startup process.
This process is divided into the following three stages.
In the first stage, the database server builds the SGA in memory based on the contents of the parameter file, and initiates the background processes such as DBWR, LGWR, and so on, starting to the Nomount state.
At this stage, the instance will be started.
Second stage, boot to Mount state.

The database server opens the control file based on the control file information that is recorded in the parameter file.
In the third stage, the database server opens the data file and redo the log file according to the information recorded in the control file, and the database server can run and process the user's request in the open state.
Thus, the control file is the hub between the instance and the database , and if the control file is lost or corrupted, the database server will not start properly.
Because control files are of particular importance, you should back up your control files immediately after you create the database, or after you modify the structure of the database.

Planning of control files

Because the control file has special importance, the number of control files and the location of the storage must be planned in detail.
The number and location of the control files are determined when the database is created and can be modified as needed during the database server run.

Mirroring of control files

You need at least one control file in a database.

If the control file is missing or corrupted, the database server will fail to start.
To prevent this, multiple control files need to be created in the database, and the control files are mirrored and identical in content.

The image of the control file is implemented by initializing the parameter Control_files .

For example, specify three control files with this parameter:

Control_files= (' D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01. CTL ',




When the database server starts, it only needs to read the contents of the first control file, and when the structure of the database changes, the modified information must be written to all control files at the same time.
If two of these control files are not available, the database server will not function correctly.
In this case, the database administrator needs to modify the value of the initialization parameter control_files, remove the control file that is not available in it, and then restart the database server.
Assuming that the control file Control01.ctl corrupted or missing, the initialization parameter control_files can be modified to:

Alter system set control_files= ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL02. CTL ', ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL03. CTL ' Scope=spfile;

Control where files are stored

To ensure the security of the control file, a basic requirement to create the control file is to mirror it.

However, if all the control files are stored on the same disk, the risk is still latent.
If the disk is damaged, all control files will be lost.
Therefore, the control files should be stored on separate disks (note that not different disk partitions on the same hard disk).
Controls the mirroring of files on multiple disks.

For example, you can store the two control files previously used on two disks, and then modify the initialization parameter control_files.


' E:\CONTROL03. CTL ' Scope=spfile;

Note: Because there is only one disk, which is to replace different disks with different partitions, it should actually be placed on different disks.

If you want to change the name or location of the control file, you should first close the database server, then copy the control files to the specified location in the operating system and, if necessary, modify the file names .
then Modify the value of the initialization parameter control_fies to point to the modified control file and finally restart the database server.

Now the database is generally stored on the disk array, this storage device is the redundancy mechanism to ensure the security of the file, this time all the control files in the same storage location.
It is important to note that in this case, multiple control files are still necessary.

How to re-create a control file

The control file is created automatically when the database is created, and in addition to the image control text during the database server run
The chances of recreating the control file are not many. But once this is required, it means that the database needs to be
An important operation. In general, the time to recreate a control file is as follows:
• The control files are all corrupted and no backup is available.
• Modify the name of the database.
• Modify some permanent parameters.
Of course, recreating the control file is not an easy task. Without careful planning, it could result in greater
The loss. Before you create a control file, you must know the name, location, size, and so on for all data files and redo log files
Information and, if necessary, the character set used by the database. To prevent the data file and redo log files from being caused
Unnecessary damage, make the files as many as possible → times to backup them.

Controlling file Management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.