3 What Is A Control File

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

What Is a Control File?

Every Oracle Database has a control file, which is a small binary file that used to keep track of the database's status and
records the physical structure of the database. The control file includes:

 The database name


 Names and locations of associated datafiles and redo log files
 The timestamp of the database creation
 The current log sequence number
 Checkpoint information

The control file must be available for writing by the Oracle Database server whenever the database is open. Without
the control file, the database cannot be mounted and recovery is difficult.

The control file of an Oracle Database is created at the same time as the database. By default, at least one copy of
the control file is created during database creation. On some operating systems the default is to create multiple
copies. You should create two or more copies of the control file during database creation. You can also create control
files later, if you lose control files or want to change particular settings in the control files.

It is strongly recommended that you multiplex control files  i.e. Have at least two control files one in one
hard disk and another one located in another disk, in a database.  In this way if control file becomes
corrupt in one disk the another copy will be available and you don’t have to do recovery of control file.

You can  multiplex control file at the time of creating a database and later on also. If you have not
multiplexed control file at the time of creating a database you can do it now by following given procedure.

BACKUP OF CONTROLFILE (TEXT FILE)

sql> ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/u02/con.sql';

you may run this sql script to generate controlfile after loss of the same.

before run this scripts start your database in nomount state and after run the same it will create and
mount database.

next ALTER DATABASE OPEN;

Multiplexing Control File

Steps:

 1.  Shutdown the Database.

SQL>SHUTDOWN IMMEDIATE;

 2. Copy the control file from old location to new location using operating system command. For example.

$ cp /u01/app/oracle/oradata/orcl/control01.ctl
/u02/app/oracle/oradata/orcl/control02.ctl
 3. Now open the parameter file and specify the new location like this

CONTROL_FILES='/u01/app/oracle/oradata/orcl/control01.ctl',
'/u02/app/oracle/oradata/orcl/control02.ctl'

 4. Start the Database

Now Oracle will start updating both the control files and, if one control file is lost you can copy  it from
another location.

You might also like