控制文件丢失恢复测试(二)
6 bytes
Database mounted.
Database opened.
所有控制文件全部丢失
[oracle@rtest test0924]$ rm /u01/app/oracle/fast_recovery_area/test0924/control02.ctl
[oracle@rtest test0924]$ rm /u01/app/oracle/oradata/test0924/control01.ctl
数据库无法正常关闭,因为在关闭的时候必须向控制文件中更新scn号。
sys@TEST0924> shutdowm immediate; SP2-0734: unknown command beginning "shutdowm i..." - rest of line ignored. sys@TEST0924> shutdown immediate; Database closed. ORA-00210: cannot open the specified control file ORA-00202: control file: '/u01/app/oracle/oradata/test0924/control01.ctl' ORA-27041: unable to open file Linux-x86_64 Error: 2: No such file or directory Additional information: 3
必须强制关闭数据库
sys@TEST0924> shutdown abort; ORACLE instance shut down. 启动数据库报控制文件验证失败,检查告警日志文件 sys@TEST0924> startup ORACLE instance started. Total System Global Area 3340451840 bytes Fixed Size 2232960 bytes Variable Size 1543507328 bytes Database Buffers 1778384896 bytes Redo Buffers 16326656 bytes ORA-00205: error in identifying control file, check alert log for more info
检查告警日志,两个控制文件都找不到了,丢失了:
Fri Oct 11 22:51:44 2013
ALTER DATABASE MOUNT
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/fast_recovery_area/test0924/control02.ctl'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/test0924/control01.ctl'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-205 signalled during: ALTER DATABASE MOUNT...
Fri Oct 11 22:51:45 2013
Checker run found 1 new persistent data failures
Time drift detected. Please check VKTM trace file for more details.
通过RMAN来进行控制文件的恢复:
1、强制启动数据库到nomount状态。 sys@TEST0924> startup force nomount; ORACLE instance started. Total System Global Area 3340451840 bytes Fixed Size 2232960 bytes Variable Size 1543507328 bytes Database Buffers 1778384896 bytes Redo Buffers 16326656 bytes 2、另开一个窗口,连接rman,执行restore控制文件恢复。 [oracle@rtest ~]$ rman target / Recovery Manager: Release 11.2.0.3.0 - Production on Fri Oct 11 22:54:28 2013 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: TEST0924 (not mounted) RMAN> restore controlfile from autobackup; Starting restore at 2013-10-11:22:55:45 using channel ORA_DISK_1 recovery area destination: /u01/app/oracle/fast_recovery_area database name (or database unique name) used for search: TEST0924 channel ORA_DISK_1: AUTOBACKUP /u01/app/oracle/fast_recovery_area/TEST0924/autobackup/2013_10_11/o1_mf_s_828559212_95k1xfbj_.bkp found in the recovery area AUTOBACKUP search with format "%F" not attempted because DBID was not set channel ORA_DISK_1: restoring control file from AUTOBACKUP /u01/app/oracle/fast_recovery_area/TEST0924/autobackup/2013_10_11/o1_mf_s_828559212_95k1xfbj_.bkp channel ORA_DISK_1: control file restore from AUTOBACKUP complete output file name=/u01/app/oracle/oradata/test0924/control01.ctl output file name=/u01/app/oracle/fast_recovery_area/test0924/control02.