5.The database instance is currently using SPFILE. View the Exhibit and examine the error that you
1: Shut down the instance, if not already done.
2: Copy one of the remaining control files to a new location.
3: Change the value of the CONTROL_FILES initialization parameter to correspond to the new location of
the control files.
4: Start up the database instance to the NOMOUNT stage.
5: Recover the database to the point of failure of the control file.
6: Open the database.
Identify the correct sequence of steps?
A.1, 2, 4, 3, 5, 6
B.2, 4, 3, 5, 6; 1 not required
C.4, 5, 6, 2, 3; 1 not required
D.5, 2, 3, 4; 1 and 6 not required
答案:A
解析:从答案中其实可以排除BC,因为如果1不需要的话,6应该也不需要,所以这里主要看一下AD
开始模拟该错误
1.确定是否使用了spfile
SQL> SELECT name,value FROM v$parameter WHERE name='spfile'
NAME VALUE
--------- ----------------------------------------
spfile /u01/oracle/11g/dbs/spfilewahaha3.ora
2.从错误中可以看出应该是一个控制文件丢失了
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /u01/oracle/oradata/wahaha3/co
ntrol01.ctl, /u01/oracle/fast_
recovery_area/wahaha3/control0
2.ctl
--删掉一个
SQL> host mv /u01/oracle/oradata/wahaha3/control01.ctl /u01/oracle/oradata/wahaha3/control01.ctl1
3.运行DB Structure Integrity check
SQL> begin
2 DBMS_HM.RUN_CHECK('DB Structure Integrity Check', 'run_dbcheck_wahaha');
3 end;
4 /
begin
*
ERROR at line 1:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/oracle/oradata/wahaha3/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-06512: at "SYS.DBMS_HM", line 191
ORA-06512: at line 2
--到了这里就模拟出了题中的错误了
4.现在开始执行恢复
先按照A的顺序来恢复
a.关闭数据库
SQL> shutdown immediate
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/oracle/oradata/wahaha3/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SQL> shutdown abort;
ORACLE instance shut down.
b.cp到新的位置
SQL> host cp /u01/oracle/fast_recovery_area/wahaha3/control02.ctl /home/oracle/control01.ctl
c.启动到nomount状态
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2232920 bytes
Variable Size 562040232 bytes
Database Buffers 264241152 bytes
Redo Buffers 2416640 bytes
d.修改丢失的那个控制文件到新的位置
SQL> SQL> alter system set control_files='/home/oracle/control01.ctl','/u01/oracle/fast_recovery_area/wahaha3/control02.ctl' scope=spfile;
System altered.
e.恢复数据库到失去控制文件那个时间点
--这里提里面的意思可能是因为shutdown abort 关闭数据库,造成需要进行恢复一下
f.打开数据库
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01507: database not mounted --需要先mount
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-00205: error in identifying control file, check alert log for more info --静态参数,需要重启
SQL> shutdown immediate --关闭
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup --启动
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2232920 bytes
Variable Size 562040232 bytes
Database Buffers 264241152 bytes
Redo Buffers 2416640 bytes
Database mounted.
Database opened
g.验证一下
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /home/oracle/control01.ctl, /u
01/oracle/fast_recovery_area/w
ahaha3/control02.ctl
最接近的就是A了
received while running the DB Structure Integrity check.
1: Shut down the instance, if not already done.
2: Copy one of the remaining control files to a new location.
3: Change the value of the CONTROL_FILES initialization parameter to correspond to the new location of
the control files.
4: Start up the database instance to the NOMOUNT stage.
5: Recover the database to the point of failure of the control file.
6: Open the database.
Identify the correct sequence of steps?
A.1, 2, 4, 3, 5, 6
B.2, 4, 3, 5, 6; 1 not required
C.4, 5, 6, 2, 3; 1 not required
D.5, 2, 3, 4; 1 and 6 not required
答案:A
解析:从答案中其实可以排除BC,因为如果1不需要的话,6应该也不需要,所以这里主要看一下AD
开始模拟该错误
1.确定是否使用了spfile
SQL> SELECT name,value FROM v$parameter WHERE name='spfile'
NAME VALUE
--------- ----------------------------------------
spfile /u01/oracle/11g/dbs/spfilewahaha3.ora
2.从错误中可以看出应该是一个控制文件丢失了
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /u01/oracle/oradata/wahaha3/co
ntrol01.ctl, /u01/oracle/fast_
recovery_area/wahaha3/control0
2.ctl
--删掉一个
SQL> host mv /u01/oracle/oradata/wahaha3/control01.ctl /u01/oracle/oradata/wahaha3/control01.ctl1
3.运行DB Structure Integrity check
SQL> begin
2 DBMS_HM.RUN_CHECK('DB Structure Integrity Check', 'run_dbcheck_wahaha');
3 end;
4 /
begin
*
ERROR at line 1:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/oracle/oradata/wahaha3/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-06512: at "SYS.DBMS_HM", line 191
ORA-06512: at line 2
--到了这里就模拟出了题中的错误了
4.现在开始执行恢复
先按照A的顺序来恢复
a.关闭数据库
SQL> shutdown immediate
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/oracle/oradata/wahaha3/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SQL> shutdown abort;
ORACLE instance shut down.
b.cp到新的位置
SQL> host cp /u01/oracle/fast_recovery_area/wahaha3/control02.ctl /home/oracle/control01.ctl
c.启动到nomount状态
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2232920 bytes
Variable Size 562040232 bytes
Database Buffers 264241152 bytes
Redo Buffers 2416640 bytes
d.修改丢失的那个控制文件到新的位置
SQL> SQL> alter system set control_files='/home/oracle/control01.ctl','/u01/oracle/fast_recovery_area/wahaha3/control02.ctl' scope=spfile;
System altered.
e.恢复数据库到失去控制文件那个时间点
--这里提里面的意思可能是因为shutdown abort 关闭数据库,造成需要进行恢复一下
f.打开数据库
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01507: database not mounted --需要先mount
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-00205: error in identifying control file, check alert log for more info --静态参数,需要重启
SQL> shutdown immediate --关闭
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup --启动
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2232920 bytes
Variable Size 562040232 bytes
Database Buffers 264241152 bytes
Redo Buffers 2416640 bytes
Database mounted.
Database opened
g.验证一下
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /home/oracle/control01.ctl, /u
01/oracle/fast_recovery_area/w
ahaha3/control02.ctl
最接近的就是A了