SQL*Plus: Release 11.2.0.4.0 Production on Fri Feb 10 11:29:33 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 3357155328 bytes
Fixed Size 2257880 bytes
Variable Size 754977832 bytes
Database Buffers 2583691264 bytes
Redo Buffers 16228352 bytes
ORA-00205: error in identifying control file, check alert log for more info 提示控制文件
SQL> alter system checkpoint;发现控制文件损坏,命令的意思是吧Oracle的SN号写到控制文件中发现控制文件损坏了。
alter system checkpoint
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 15000
Session ID: 190 Serial number: 3
SQL> show parameter backg 查看告警日志路径
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
background_core_dump string partial
background_dump_dest string /home/oracle/app/diag/rdbms/or
cl/orcl/trace
[oracle@Oracle11G orcl]$ cd /home/oracle/app/diag/rdbms/orcl/orcl/trace
[oracle@Oracle11G trace]$ ls
alert_orcl.log orcl_dbrm_6277.trm orcl_mmon_6316.trc
cdmp_20170206111059 orcl_dbrm_6300.trc orcl_mmon_6316.trm
cdmp_20170206111102 orcl_dbrm_6300.trm orcl_ora_14007.trc
cdmp_20170206111115 orcl_diag_6298_20170210112651.trc orcl_ora_14007.trm
cdmp_20170206111117 orcl_diag_6298_20170210112651.trm orcl_ora_14981.trc
cdmp_20170206111217 orcl_diag_6298.trc orcl_ora_14981.trm
cdmp_20170210112630 orcl_diag_6298.trm orcl_ora_15032.trc
cdmp_20170210112633 orcl_dm00_14011.trc orcl_ora_15032.trm
cdmp_20170210112644 orcl_dm00_14011.trm orcl_ora_25055.trc
cdmp_20170210112651 orcl_j000_10705.trc orcl_ora_25055.trm
orcl_arc0_6307.trc orcl_j000_10705.trm orcl_ora_25057.trc
orcl_arc0_6307.trm orcl_j000_18632.trc orcl_ora_25057.trm
orcl_arc0_6336.trc orcl_j000_18632.trm orcl_ora_6262.trc
orcl_arc0_6336.trm orcl_j000_7537.trc orcl_ora_6262.trm
orcl_arc1_6168.trc orcl_j000_7537.trm orcl_ora_6283.trc
orcl_arc1_6168.trm orcl_j003_12017.trc orcl_ora_6283.trm
orcl_arc1_6338.trc orcl_j003_12017.trm orcl_ora_6305.trc
orcl_arc1_6338.trm orcl_j003_8824.trc orcl_ora_6305.trm
orcl_arc2_6311.trc orcl_j003_8824.trm orcl_ora_6328.trc
orcl_arc2_6311.trm orcl_lgwr_6285.trc orcl_ora_6328.trm
orcl_arc2_6340.trc orcl_lgwr_6285.trm orcl_p000_6330.trc
orcl_arc2_6340.trm orcl_lgwr_6308.trc orcl_p000_6330.trm
orcl_arc3_6172.trc orcl_lgwr_6308.trm orcl_p001_6332.trc
orcl_arc3_6172.trm orcl_m000_12307.trc orcl_p001_6332.trm
orcl_arc3_6313.trc orcl_m000_12307.trm orcl_p002_6334.trc
orcl_arc3_6313.trm orcl_m000_15072.trc orcl_p002_6334.trm
orcl_arc3_6342.trc orcl_m000_15072.trm orcl_vkrm_12011.trc
orcl_arc3_6342.trm orcl_m002_20168.trc orcl_vkrm_12011.trm
orcl_cjq0_6191.trc orcl_m002_20168.trm orcl_vkrm_19940.trc
orcl_cjq0_6191.trm orcl_m002_9170.trc orcl_vkrm_19940.trm
orcl_cjq0_6332.trc orcl_m002_9170.trm orcl_vkrm_8818.trc
orcl_cjq0_6332.trm orcl_mman_15051.trc orcl_vkrm_8818.trm
orcl_cjq0_6365.trc orcl_mman_15051.trm orcl_vktm_15039.trc
orcl_cjq0_6365.trm orcl_mman_25076.trc orcl_vktm_15039.trm
orcl_ckpt_15057.trc orcl_mman_25076.trm orcl_vktm_25064.trc
orcl_ckpt_15057.trm orcl_mman_6281.trc orcl_vktm_25064.trm
orcl_ckpt_6287.trc orcl_mman_6281.trm orcl_vktm_6122.trc
orcl_ckpt_6287.trm orcl_mman_6304.trc orcl_vktm_6122.trm
orcl_ckpt_6310.trc orcl_mman_6304.trm orcl_vktm_6269.trc
orcl_ckpt_6310.trm orcl_mmon_6146.trc orcl_vktm_6269.trm
orcl_dbrm_6130.trc orcl_mmon_6146.trm orcl_vktm_6292.trc
orcl_dbrm_6130.trm orcl_mmon_6293.trc orcl_vktm_6292.trm
orcl_dbrm_6277.trc orcl_mmon_6293.trm
这里面有很多文件可以不用要的,比如trc和trm这都是启动和停止的时候产生的。
[oracle@Oracle11G trace]$
[oracle@Oracle11G trace]$ rm -rf *.trc
[oracle@Oracle11G trace]$ rm -rf *.trm
[oracle@Oracle11G trace]$ ls
alert_orcl.log cdmp_20170206111117 cdmp_20170210112644
cdmp_20170206111059 cdmp_20170206111217 cdmp_20170210112651
cdmp_20170206111102 cdmp_20170210112630
cdmp_20170206111115 cdmp_20170210112633
这样子的时候我们可以去查看alert_orcl.log内容 /ORA去搜你的错误
Errors in file /home/oracle/app/diag/rdbms/orcl/orcl/trace/orcl_ckpt_26325.trc:
ORA-00202: control file: '/home/oracle/app/oradata/orcl/control01.ctl'
Errors in file /home/oracle/app/diag/rdbms/orcl/orcl/trace/orcl_ckpt_26325.trc (incident=7300):
ORA-00227: corrupt block detected in control file: (block 1, # blocks 1)
ORA-00202: control file: '/home/oracle/app/oradata/orcl/control01.ctl'
日志可以看出是控制文件头坏了那我们完全可以通过第2份日志文件去恢复出来
[oracle@Oracle11G ~]$ cd $ORACLE_BASE
[oracle@Oracle11G app]$ cd fast_recovery_area/
[oracle@Oracle11G fast_recovery_area]$ cd orcl/
[oracle@Oracle11G orcl]$ ls
control02.ctl
[oracle@Oracle11G orcl]$ cp control02.ctl /home/oracle/app/oradata/orcl/control01.ctl
查看控制文件
[oracle@Oracle11G ~]$ cd /home/oracle/app/oradata/orcl/
[oracle@Oracle11G orcl]$ ls
control01.ctl redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf
[oracle@Oracle11G orcl]$ du -sh control01.ctl
9.4M control01.ctl
[oracle@Oracle11G orcl]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Feb 10 11:42:59 2017
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吧数据库关闭重新开启
SQL> startup; 启动
ORACLE instance started.
Total System Global Area 3357155328 bytes
Fixed Size 2257880 bytes
Variable Size 754977832 bytes
Database Buffers 2583691264 bytes
Redo Buffers 16228352 bytes
Database mounted.
Database opened. 正常启动成功
其他控制文件操作
SQL> desc v$controlfile;
Name Null? Type
----------------------------------------- -------- ----------------------------
STATUS VARCHAR2(7)
NAME VARCHAR2(513)
IS_RECOVERY_DEST_FILE VARCHAR2(3)
BLOCK_SIZE NUMBER
FILE_SIZE_BLKS NUMBER
SQL> select name from v$controlfile;控制文件路径
NAME
------------------------------------------- 控制文件2份都是同时写上去的,如果坏了可以重第2个恢复出来,他们是主备关系的。
/home/oracle/app/oradata/orcl/control01.ct
/home/oracle/app/fast_recovery_area/orcl/control02.ctl
SQL> show parameter backg
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
background_core_dump string partial
background_dump_dest string /home/oracle/app/diag/rdbms/or
cl/orcl/trace