First, what is the role of controlling the document?
The control file records the following information:
1, the creation time of the database
2. Location of data files
3. Location of log files
such as
The role is to instruct the database to locate the data files, log files, and boot the database to the open state.
Instead of describing it in words, let's see what's in Control_file. Then analyze each of the following:
sql> Show parameter control_filename TYPE VALUE---------------------------------------------- -------------------------------control_file_record_keep_time integer 7Control_ Files string /u01/app/oracle/oradata/orcl/c /u01/app/oracle/ Oradata/orcl/control02.ctl,/u /app/oracle/oradata/orcl/con Trol03.ctl
You can see the location of the control_file in the/u01/app/oracle/oradata/orcl/directory.
sql> ALTER DATABASE backup Controlfile to trace;
We go to this directory:/u01/app/oracle/admin/orcl/udump
[email protected] udump]$ LS-Ltotal192-rw-r-----1Oracle Oinstall854Sep the One: $ORCL_ORA_10453.TRC-rw-r-----1Oracle Oinstall12332Sep - -: GenevaORCL_ORA_14205.TRC-rw-r-----1Oracle Oinstall705Sep - -: -ORCL_ORA_21120.TRC-rw-r-----1Oracle Oinstall726Sep - -: -ORCL_ORA_21124.TRC-rw-r-----1Oracle Oinstall855Sep the One: theORCL_ORA_23699.TRC-rw-r-----1Oracle Oinstall855Sep - +: -Orcl_ora_23743.trc
Find a time that is today a file that ends with. TRC. Use VI to open it.
CREATE Controlfile Reuse DATABASE"ORCL"resetlogs noarchivelog maxlogfiles -maxlogmembers3Maxdatafiles -maxinstances8maxloghistory292LOGFILE GROUP1 '/u01/app/oracle/oradata/orcl/redo01.log'SIZE 50M, GROUP2 '/u01/app/oracle/oradata/orcl/redo02.log'SIZE 50M, GROUP3 '/u01/app/oracle/oradata/orcl/redo03.log'SIZE 50M--STANDBY Logfiledatafile'/u01/app/oracle/oradata/orcl/system01.dbf', '/u01/app/oracle/oradata/orcl/undotbs01.dbf', '/u01/app/oracle/oradata/orcl/sysaux01.dbf', '/u01/app/oracle/oradata/orcl/users01.dbf', '/u01/app/oracle/oradata/orcl/example01.dbf'CHARACTER SET Al32utf8
You can see where the data files and log files are stored.
Two, the control file has three, three control files are all identical. This is used for redundant backups, and if one of them is broken, it can be re-overwritten with another one. We then simulate an environment. Let's break down one of the control files:
[email protected] orcl]$ lscontrol01.ctl control03.ctl redo01.log redo03.log system01.dbf undotbs01.dbfcontrol02.ctl example01.dbf redo02.log sysaux01.dbf temp01.dbf Users01.dbf[[email protected] orcl]$ mv Control03.ctl. /Control03.ctl.bak[[email protected] orcl]$ lscontrol01.ctl control03.ctl.bak redo01.log Redo03.log system01.dbf undotbs01.dbfcontrol02.ctl example01.dbf redo02.log SYSAUX01.DBF temp01.dbf users01.dbf
Then we log in and start up:
Sql> startuporacle instance started. Total System Globalarea608174080 bytesfixed Size 1275128 bytesvariable Size 222300936 bytesdatabase buffers 381681664 Bytesredo buffers 2916352 Bytesora-00205 in for more info
We open the alarm file to see:
[[email protected] bdump]$ pwd /u01/app/oracle/admin/orcl/BDUMPVI See: alert_orcl.logwed Sep 17 : 34 : 18 CST 2014 ora -00210 : Cannot open the specified control Fileora -00202 : Control file: '
It is obvious that can not open, nonsense, certainly can not open, I have to kill you find it is strange.
Here are some of the two solutions that I have given you:
Method One: Modify the SPFile, not to say spfile inside record the location of the parameter file, and must be recorded in 3 positions, then we will put the third control file to kill
Process:
Create a pfile because SPFile is a binary file and cannot be modified
sql> Create pfile='/u01/pfile.ora' from spfile; File created.
Then edit the parameter file Pfile:
[[Email protected] dbs]$ CD/U01[[email protected]-Oracle u01]$ lsoracle pfile.ora[[email protected]-Oracle u01]$ VI pfile.ora*.control_files=tl','/u01/oracle/oradata/orcl/control02.ctl','/u01/oracle/oradata/orcl/control03.ctlorcl.__db_cache_size=176160768orcl.__java_pool_size=4194304orcl.__large_pool_size=4194304orcl.__shared_pool_size=92274688orcl.__streams_pool_size=0*.audit_file_dest='/u01/oracle/admin/orcl/adump'*.background_dump_dest='/u01/oracle/admin/orcl/bdump'*.compatible='10.2.0.1.0'*.control_files='/u01/oracle/oradata/orcl/control02.ctl','/u01/oracle/oradata/orcl/control01.ctl'----Highlights here, originally there is a 01,02,03 control file, I have to delete the database can be started when the time not to find a third, lost it. *.core_dump_dest='/u01/oracle/admin/orcl/cdump'*.db_block_size=8192*.db_domain="'*.db_file_multiblock_read_count= -*.db_name='ORCL'*.db_recovery_file_dest='/u01/oracle/flash_recovery_area'*.db_recovery_file_dest_size=2147483648*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'*.job_queue_processes=Ten*.open_cursors= -*.pga_aggregate_target=93323264*.processes= Max*.remote_login_passwordfile='EXCLUSIVE'*.sga_target=279969792*.undo_management='AUTO'*.undo_tablespace='UNDOTBS1'*.user_dump_dest='/u01/oracle/admin/orcl/udump'
Re-create it just fine spfile:
Sql> Create SPFile frompfile='/u01/pfile.ora'; File created. SQL>Startup;oracle instance started. Total System Global Area281018368bytesfixed Size2020192bytesvariable Size100666528Bytesdatabase Buffers176160768Bytesredo Buffers2170880Bytesdatabase mounted.
Database opened.
--See no, database only with 2 control files can also be started. SQL>Show parameter controlname TYPE VALUE------------------------------------ ----------- ------------------------------control_file_record_keep_time integer7Control_filesstring/u01/oracle/oradata/orcl/contr Ol02.ctl,/u01/oracle/oradata/ORCL/control01.ctl
Method Two: Not to say that 3 control files are identical, then why not copy after renaming it?
Process:
[[email protected] orcl]$ CP control01.ctl control03.ctl[[email protected] orcl]$ lscontrol01.ctl Control03.ctl.bak redo02.log system01.dbf users01.dbfcontrol02.ctl example01.dbf Redo03.log temp01.dbfcontrol03.ctl redo01.log sysaux01.dbf undotbs01.dbf
Start it up:
sql> Show parameter control_filename TYPE VALUE---------------------------------------------- -------------------------------control_file_record_keep_time integer 7Control_ Files string /u01/app/oracle/oradata/orcl/c /u01/app/oracle/ Oradata/orcl/control02.ctl,/u /app/oracle/oradata/orcl/con Trol03.ctl
It's just as possible.
Oracle control file Consistency "Weber Productions"