Home >Database >Mysql Tutorial >恢复控制文件故障详细步骤

恢复控制文件故障详细步骤

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:03:131194browse

如果控制文件丢失或损坏,则实例通常会中止。然后,您必须执行以下步骤: 1.关闭实例(如果它仍处于打开状态)。 2.通过复制现有控制文件还原缺失的控制文件。 3.启动实例。 实验: 1.查看当前控制文件情况 show parameter control_files 2.模拟控制文件丢失

如果控制文件丢失或损坏,则实例通常会中止。然后,您必须执行以下步骤:

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.强制关闭数据库
SYS@ORCL>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

SYS@ORCL>shutdown abort
ORACLE instance shut down.

SYS@ORCL>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.将另外的控制文件替代此控制文件
[oracle@Demon control_bak]$ cp /u01/app/oracle/oradata/ORCL/controlfile/o1_mf_b0fh9927_.ctl

control03.ctl
[oracle@Demon control_bak]$ ls
control03.ctl

7.启动数据库
SYS@ORCL>startup
--成功启库

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:LogdumpNext article:数据库设计之外键的思考