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:
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.
1. Shutdown the Database.
2. Copy the control file from old location to new location using operating system command. For example.
$ cp /u01/oracle/ica/control.ora /u02/oracle/ica/control.ora
3. Now open the parameter file and specify the new location like this
Change it to
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.
If you ever want to change the name of database or want to change the setting of MAXDATAFILES, MAXLOGFILES, MAXLOGMEMBERS then you have to create a new control file.
Follow the given steps to create a new controlfile
1. First generate the create controlfile statement
SQL>alter database backup controlfile to trace;
After giving this statement oracle will write the CREATE CONTROLFILE statement in a trace file. The trace file will be randomly named something like ORA23212.TRC and it is created in USER_DUMP_DEST directory.
2. Go to the USER_DUMP_DEST directory and open the latest trace file in text editor. This file will contain the CREATE CONTROLFILE statement. It will have two sets of statement one with RESETLOGS and another without RESETLOGS. Since we are changing the name of the Database we have to use RESETLOGS option of CREATE CONTROLFILE statement. Now copy and paste the statement in a file. Let it be c.sql
3. Now open the c.sql file in text editor and set the database name from ica to prod shown in an example below
SET DATABASE prod
LOGFILE GROUP 1 ('/u01/oracle/ica/redo01_01.log',
GROUP 2 ('/u01/oracle/ica/redo02_01.log',
GROUP 3 ('/u01/oracle/ica/redo03_01.log',
DATAFILE '/u01/oracle/ica/system01.dbf' SIZE 3M,
'/u01/oracle/ica/rbs01.dbs' SIZE 5M,
'/u01/oracle/ica/users01.dbs' SIZE 5M,
'/u01/oracle/ica/temp01.dbs' SIZE 5M
4. Start and do not mount the database.
5. Now execute c.sql script
6. Now open the database with RESETLOGS
SQL>ALTER DATABASE OPEN RESETLOGS;