Sie sind auf Seite 1von 2

What Is a Control File?

Every Oracle Database has a control file, which is a small binary file that
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.

Multiplex Control Files on Different Disks


One of the basic tasks of a DBA is to multiplex the Control Files. One of the biggest
reasons why we multiplex control files is to create backups of the primary control
file, which records the physical structure of the database. When the control file is
damaged there is no way you can bring it back to life, unless you have the backup.
Backup of control files must also be stored in a different physical disk for high
availability. Of course, were very much aware that there is such a thing as disk
failure. The Control File should always be multiplexed/backed up, as a best
practice, each time that Tablespaces and Redo Log Files are dropped or added. This
is also done when a datafile is renamed.The following is a quick step-by-step for
multiplexing the Control File:
Suppose our SID is called ORCL,
1. Connect to the ORCL Database as SYS (SYSDBA priveleges), then EXECUTE a
SHUTDOWN IMMEDIATE command
2. Locate the Control File named CONTROL1.CTL
(\oracle\product\10.2.0\oradata\ORCL\control01.ctl)
3. Copy the Control File into a different location (different disk); and rename the
copied file with the next number suffix (CONTROL03.CTL, if you already have
CONTROL01.CTL & CONTROL02.CTL). Oracle Databases should at least have two (2)
Control Files.

4. Open the initialization file, initSID.ora (which in our sample is initORCL.ora,


following the standards of best practices in object naming). The initialization file is
located in ORACLE_BASE\Admin\ORCL\pfile directory (OFA compliant).
5. Add the new, copied file onto the initialization parameter file The new control file
is in the D drive:
control_files=
(
C:\oracle\product\10.2.0\oradata\ORCL\control01.ctl,
C:\oracle\product\10.2.0\oradata\ORCL\control02.ctl,
D:\oracle\product\10.2.0\oradata\ORCL\control03.ctl
)
6. Close and Save the file; and restart the Database using STARTUP command
(MOUNT mode) with the PFILE parameter.

Manually recreate the control file


Issue the CREATE CONTROL FILE statement against the DB. Lookup the syntax in
the SQL reference guide. Most of the info required to rebuild the control file should
be in the alert.log.
Example:
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "orcl"
NORESETLOGS [archivelog/noarchivelog]
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 10
MAXINSTANCES 1
MAXLOGHISTORY 113
LOGFILE
GROUP 1 'D:\ORACLE\ORADATA\ORCL\REDO01.LOG' SIZE 10M,
GROUP 2 'D:\ORACLE\ORADATA\ORCL\REDO02.LOG' SIZE 10M,
GROUP 3 'D:\ORACLE\ORADATA\ORCL\REDO03.LOG' SIZE 10M
DATAFILE
'D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF' SIZE xxx,
'D:\ORACLE\ORADATA\ORCL\USERS01.DBF' SIZE xxx,
...
CHARACTER SET [characater_set];

Das könnte Ihnen auch gefallen