What is a controlfile in oracle, how to recreate the controlfile

Controlfile :
Control file is small binary file, it contains physical structure of the oracle database. Each database must contain one or more control files. It contains 

- The database name
- Datafiles and redolog files information of associated database.
- Timestamp of the database creation.
- The current log sequence number
- Check point information.

We can specify the controlfile names using the “control_files” parameter.
Control_files=(/u01/oracle/prod/control01.ctl, /u02/oracle/prod/control02.ctl, /u03/oracle/prod/control03.ctl)

Size of the control file can vary from release to realse. Configuration parameters maxlogfiles, maxlogmembers, maxdatafiles and maxinstances affect the control file size.

How to multiplexing the controlfiles:

1. Shut down the database.
2. Edit the control_file parameter and set the new locations.
For example having only one controlfile at /u01/app/oracle/oradata/control1.ctl, this file we need to copy to new location and mention that new location at parameter.

$cp /u01/app/oracle/oradata/control1.ctl /u02/app/oracle/oradata/control2.ctl

$ cp /u01/app/oracle/oradata/control1.ctl /u03/app/oracle/oradata/control3.ctl

3. Restart the database.

Creation of new control file:  

We can create the new control file in 2 situations.

1. All the available control files corrupted and have no backup of the control file.
2. Rename the database.

Renaming of the Database using controlfile:

We can create the controlfile using create controlfile statement. We can rename the database base using creation control file. We do mention the new name at create controlfile statement.

CREATE CONTROLFILE SET DATABASE prod
LOGFILE GROUP 1 ('/u01/oracle/prod/redo01_01.log',
'/u01/oracle/prod/redo01_02.log'),
GROUP 2 ('/u01/oracle/prod/redo02_01.log',
'/u01/oracle/prod/redo02_02.log'),
GROUP 3 ('/u01/oracle/prod/redo03_01.log',
'/u01/oracle/prod/redo03_02.log')
RESETLOGS
DATAFILE '/u01/oracle/prod/system01.dbf' SIZE 3M,
'/u01/oracle/prod/rbs01.dbs' SIZE 5M,
'/u01/oracle/prod/users01.dbs' SIZE 5M,
'/u01/oracle/prod/temp01.dbs' SIZE 5M
MAXLOGFILES 50
MAXLOGMEMBERS 3
MAXLOGHISTORY 400
MAXDATAFILES 200

0 $type={blogger}:

Post a Comment