SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/orcl/control01.ctl
/u01/oracle/fast_recovery_area/orcl/control02.ctl
SQL> ho rm /u01/oracle/oradata/orcl/control01.ctl
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@com ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Jan 6 08:58:33 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06003: ORACLE error from target database:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/oracle/oradata/orcl/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
[oracle@com ~]$
[oracle@com ~]$
[oracle@com ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Jan 6 08:58:44 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
--删除控制文件后关闭数据库,这样是关不掉的。
SQL> shutdown immediate;
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/oracle/oradata/orcl/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
--用abort 强制关闭数据库
SQL> shutdown abort
ORACLE instance shut down.
--启动数据库,发现数据库无法启动,报错ORA-00205。这时候数据库处于nomount阶段。
SQL> startupORACLE instance started.
Total System Global Area 1553305600 bytes
Fixed Size 2253544 bytes
Variable Size 922750232 bytes
Database Buffers 620756992 bytes
Redo Buffers 7544832 bytes
ORA-00205: error in identifying control file, check alert log for more info
--查看控制文件列表
SQL> show parameter control_files;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string/u01/oracle/oradata/orcl/contr
ol01.ctl, /u01/oracle/fast_rec
overy_area/orcl/control02.ctl
--查看是否存在控制文件
SQL> ho ls /u01/oracle/oradata/orcl/control01.ctlls: 无法访问/u01/oracle/oradata/orcl/control01.ctl: 没有那个文件或目录
SQL> ho ls /u01/oracle/fast_recovery_area/orcl/control02.ctl
/u01/oracle/fast_recovery_area/orcl/control02.ctl
--复制存在的控制文件为刚才删除的控制文件
SQL> ho cp /u01/oracle/fast_recovery_area/orcl/control02.ctl /u01/oracle/oradata/orcl/control01.ctl
--开启数据库
SQL> alter database mount;
Database altered.
SQL> alter database open;
Database altered.