oracle控制文件恢复测试演练



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> startup
ORACLE 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.ctl
ls: 无法访问/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.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值