Control File.
Contents in Control file:-
• Database information (RESETLOGS SCN and their time stamp).
• Archive log history.
• Tablespace and datafile records (filenames,datafile checkpoints,read/write status,offline or
not).
• Redo threads (current online redo log).
• Database's creation date- Timestamp.
• Database name.
• Current archive log mode.
• Log records (sequence numbers, SCN range in each log).
• RMAN catalog.
• Database block corruption information.
• Database ID, which is unique to each DB.
Size of The control files :
The size of the control files is governed by the following parameters.
• Maxlogfiles -- No. of log groups that can be created.
• Maxlogmembers – No. of log members that can be created in Log group.
• Maxloghistory -- History of log files, that will be stored in Control file.
• Maxinstances – No. of instances that can be accommodated in Database.
1> Create binary control file.
2> Create SQL file to create control file.
3> Dropping control file.
4> Multiplexing control file. (PFILE)
5> Multiplexing control file. (SPFILE)
1> Make a binary copy of the control file :
SQL>ALTER DATABASE BACKUP CONTROLFILE TO '/tmp/control.bkp';
2> Generate an SQL file to create the control file :
SQL>ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tmp/create_control.sql';`
3> Dropping a Control File :
Control files are dropped when a location is no longer appropriate, e.g., a disk drive has been
eliminated from use for a database.
1. Shut down the database. (ABORT)
2. Edit the init.ora file CONTROL_FILES parameter by removing the old control file name.
3. Restart the database
4> Multiplexing Control FIle : ( PFILE)
1. Shutdown the database. ( IMMEDIATE)
2. Copy controlfile to desired location with proper naming convention.
3. Make entry in Pfile.
4. Start Database.
SQL>select name from v$controlfile;
1> SQL> shutdown immediate
2> # copy control file --- cp control01.ctl control02.ctl
3> Make entry in pfile.
4> SQL> Startup
Here, you can see 2 control files in your database now.
5> Multiplexing Control FIle : ( SPFILE)
1> Change parameter control_files in database to point multiple controlfiles.
2> Shutdown database. (IMMEDIATE)
3> Copy control file to desired location with proper naming convention.
4> Start database.
1> SQL> alter system set
control_files='/u01/app/oracle/oradata/chetan/control/control01.ctl','/u01/app/oracle/
oradata/chetan/control/control02.ctl','/u01/app/oracle/oradata/chetan/control/control
03.ctl' scope=spfile;
2> SQL>Shutdown immediate;
3> Copy control file. – cp control01.ctl control03.ctl
4> Startup;
Here you can see 3 control files in your database with SPFILE in use!!!