如果控制文件丢失或损坏,则实例通常会中止。然后,您必须执行以下步骤:
1.关闭实例(如果它仍处于打开状态)。
2.通过复制现有控制文件还原缺失的控制文件。 3.启动实例。
实验:
1.查看当前控制文件情况
show parameter control_files
2.模拟控制文件丢失故障
!rm /home/oracle/control_bak/control03.ctl
show parameter control_files --被删除的控制文件仍然存在
3.触发检查点操作
alter system checkpoint;
4.检查alert log的输出结果
select * from v$diag_info;
在alert中查看
/u01/app/oracle/diag/rdbms/orcl/ORCL/trace
adrci --在Oracle用户下
adrci> show homepath
ADR Homes:
diag/rdbms/orcl/ORCL
adrci> set homepath diag/rdbms/orcl/ORCL
adrci> show homepath
ADR Homes:
diag/rdbms/orcl/ORCL
adrci>
adrci> help show alert
adrci> show alert -tail 20
--报错
Errors in file /u01/app/oracle/diag/rdbms/orcl/ORCL/trace/ORCL_m000_22432.trc:
ORA-00210: cannot open the specified control file
……
Linux-x86_64 Error: 2: No such file or directory
--相关报错日志
5.强制关闭数据库
[email protected]>shutdown immediate --关闭数据库报错
ORA-00210: cannot open the specified control file
ORA-00202: control file: ‘/home/oracle/control_bak/control03.ctl‘
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
[email protected]>shutdown abort
ORACLE instance shut down.
[email protected]>startup --启动数据库时仍然报错
ORACLE instance started.
Total System Global Area 839282688 bytes
Fixed Size 2257880 bytes
Variable Size 507513896 bytes
Database Buffers 327155712 bytes
Redo Buffers 2355200 bytes
ORA-00205: error in identifying control file, check alert log for more info
--无法开启数据库
6.将另外的控制文件替代此控制文件
[[email protected] control_bak]$ cp /u01/app/oracle/oradata/ORCL/controlfile/o1_mf_b0fh9927_.ctl
control03.ctl
[[email protected] control_bak]$ ls
control03.ctl
7.启动数据库
[email protected]>startup
--成功启库