导读:某客户单位数据库出现异常,大致现象是:数据库状态是open的,但是其中一个数据文件无法访问,本文分享排查原因与解决问题的整个过程。
通过ls 查看文件都报错,如下所示:
[oracle@oracledata01 oracle]$ lsls: 无法访问zf4.dbf: 输入/输出错误
同时dd命令也无法读取该文件:
[oracle@oracledata01 fd]$ dd if=zf4.dbf bs=8192 count=1 skip=1|od -x|header -1bash: header: command not founddd: 正在打开"zf4.dbf": 没有那个文件或目录
此时在从数据库层面看到的信息类似如下:
Tue Apr 28 16:49:51 2020Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_ora_9146.trc:ORA-01157: 无法标识/锁定数据文件 11 - 请参阅 DBWR 跟踪文件ORA-01110: 数据文件 11: '/oracle_data/oracle/zf4.dbf'ORA-1157 signalled during: ALTER DATABASE OPEN...Tue Apr 28 16:49:51 2020Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_m000_9152.trc:ORA-27037: 无法获得文件状态Linux-x86_64 Error: 5: Input/output errorAdditional information: 3ORA-01122: 数据库文件 11 验证失败ORA-01110: 数据文件 11: '/oracle_data/oracle/zf4.dbf'ORA-01565: 标识文件 '/oracle_data/oracle/zf4.dbf' 时出错ORA-27037: 无法获得文件状态Linux-x86_64 Error: 5: Input/output errorAdditional information: 3Tue Apr 28 16:50:19 2020USER (ospid: 9309): terminating the instance
从上述信息来看,数据库第11号文件无法读取。
在我们进行恢复之前,客户进行了多次尝试,还遭遇了一些数据库坏块,也遇到了不少ora-00600 错误:
Wed Apr 29 03:10:12 2020Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_j009_65816.trc:ORA-12012: 自动执行作业 "ZX_XT"."JS_XT_XZGLXX_XZXK_FR" 出错ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小ORA-06512: 在 "ZX_XT.PKG_双公示接收_邢_2019", line 1071ORA-00942: 表或视图不存在ORA-02063: 紧接着 line (起自 BM_SJJH)alter database datafile 11 resize 20gCompleted: alter database datafile 11 resize 20gWed Apr 29 03:10:15 2020Corrupt Block FoundCONT = 0, TSN = 1, TSNAME = SYSAUXRFN = 3, BLK = 3, RDBA = 12582915OBJN = 1, OBJD = -1, OBJECT = _NEXT_OBJECT, SUBOBJECT =SEGMENT OWNER = SYS, SEGMENT TYPE = Invalid TypeWed Apr 29 03:10:15 2020Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_m006_66106.trc (incident=246250):ORA-00600: 内部错误代码, 参数: [kdBlkCheckError], [3], [3], [18018], [], [], [], [], [], [], [], []Incident details in: /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/incident/incdir_246250/orcl_m006_66106_i246250.trcWed Apr 29 03:10:15 2020......Wed Apr 29 03:11:00 2020Doing block recovery for file 3 block 3Resuming block recovery (PMON) for file 3 block 3Block recovery from logseq 50078, block 15827 to scn 14514058257813Wed Apr 29 03:11:00 2020Recovery of Online Redo Log: Thread 1 Group 3 Seq 50078 Reading mem 0Mem# 0: /oracle_data/oradata/orcl/redo03.logBlock recovery completed at rba 50078.23957.16, scn 3379.1363764630Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_m004_66271.trc (incident=245043):ORA-00600: 内部错误代码, 参数: [kdBlkCheckError], [3], [3], [18018], [], [], [], [], [], [], [], []Incident details in: /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/incident/incdir_245043/orcl_m004_66271_i245043.trcUse ADRCI or Support Workbench to package the incident.See Note 411.1 at My Oracle Support for error and packaging details.Wed Apr 29 03:11:01 2020Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_m004_66271.trc:ORA-00600: 内部错误代码, 参数: [kdBlkCheckError], [3], [3], [18018], [], [], [], [], [], [], [], []Wed Apr 29 03:11:02 2020......Wed Apr 29 03:15:49 2020Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_j000_65779.trc (incident=245026):ORA-00600: internal error code, arguments: [13011], [7907], [12713924], [44], [12687314], [0], [], [], [], [], [], []ORA-01403: no data foundORA-06512: at "SYS.DBMS_AQ_INV", line 1248ORA-06512: at line 1Incident details in: /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/incident/incdir_245026/orcl_j000_65779_i245026.trcWed Apr 29 03:15:52 2020Dumping diagnostic data in directory=[cdmp_20200429031552], requested by (instance=1, osid=65779 (J000)), summary=[incident=245026].Use ADRCI or Support Workbench to package the incident.See Note 411.1 at My Oracle Support for error and packaging details.Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_j000_65779.trc (incident=245027):ORA-00600: internal error code, arguments: [13011], [7907], [12713924], [44], [12687314], [0], [], [], [], [], [], []ORA-01403: no data foundORA-06512: at "SYS.DBMS_AQ_INV", line 1248ORA-06512: at line 1Incident details in: /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/incident/incdir_245027/orcl_j000_65779_i245027.trcUse ADRCI or Support Workbench to package the incident.......Wed Apr 29 04:05:07 2020Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_m003_76294.trc:ORA-00600: 内部错误代码, 参数: [kdBlkCheckError], [3], [3], [18018], [], [], [], [], [], [], [], []Wed Apr 29 04:05:08 2020Dumping diagnostic data in directory=[cdmp_20200429040508], requested by (instance=1, osid=76263), summary=[incident=282250].Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_ora_76263.trc (incident=282251):ORA-00600: 内部错误代码, 参数: [qosdFindObjRead: objcnt mismatch], [], [], [], [], [], [], [], [], [], [], []Incident details in: /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/incident/incdir_282251/orcl_ora_76263_i282251.trcUse ADRCI or Support Workbench to package the incident.See Note 411.1 at My Oracle Support for error and packaging details.Wed Apr 29 04:05:10 2020Sweep [inc][282251]: completedSweep [inc2][282265]: completedSweep [inc2][282251]: completedWed Apr 29 04:05:10 2020Dumping diagnostic data in directory=[cdmp_20200429040510], requested by (instance=1, osid=76263), summary=[incident=282251].Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_ora_76263.trc (incident=282252):ORA-00600: 内部错误代码, 参数: [qosdFindObjRead: objcnt mismatch], [], [], [], [], [], [], [], [], [], [], []Incident details in: /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/incident/incdir_282252/orcl_ora_76263_i282252.trcUse ADRCI or Support Workbench to package the incident.See Note 411.1 at My Oracle Support for error and packaging details.Wed Apr 29 04:07:26 2020......Wed Apr 29 04:24:01 2020Sweep [inc][279857]: completedSweep [inc2][279857]: completedErrors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_ora_78503.trc (incident=279858):ORA-00600: 内部错误代码, 参数: [qosdFindObjRead: objcnt mismatch], [], [], [], [], [], [], [], [], [], [], []Incident details in: /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/incident/incdir_279858/orcl_ora_78503_i279858.trcUse ADRCI or Support Workbench to package the incident.See Note 411.1 at My Oracle Support for error and packaging details.Wed Apr 29 04:24:03 2020Sweep [inc][279858]: completedSweep [inc2][279858]: completedWed Apr 29 04:24:04 2020Dumping diagnostic data in directory=[cdmp_20200429042404], requested by (instance=1, osid=78503), summary=[incident=279858].Wed Apr 29 04:25:57 2020Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_ora_78738.trc (incident=282222):ORA-00600: 内部错误代码, 参数: [qosdFindObjRead: objcnt mismatch], [], [], [], [], [], [], [], [], [], [], []Incident details in: /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/incident/incdir_282222/orcl_ora_78738_i282222.trcUse ADRCI or Support Workbench to package the incident.See Note 411.1 at My Oracle Support for error and packaging details.Wed Apr 29 04:25:58 2020Sweep [inc][282222]: completedSweep [inc2][282222]: completedWed Apr 29 04:25:58 2020Dumping diagnostic data in directory=[cdmp_20200429042558], requested by (instance=1, osid=78738), summary=[incident=282222].Errors in file /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/trace/orcl_ora_78738.trc (incident=282223):ORA-00600: 内部错误代码, 参数: [qosdFindObjRead: objcnt mismatch], [], [], [], [], [], [], [], [], [], [], []Incident details in: /oracle_app/Oracle12c/diag/rdbms/orcl/orcl/incident/incdir_282223/orcl_ora_78738_i282223.trc
上述ora-00600 错误,总的来都是常见的,几乎都可以定性为数据坏块。
对于file 3的坏块,处理相对简单,直接drop或者truncate相关对象即可,然后重建awr。
但是对于第11号数据文件,怎么办呢?这里我们的处理方法是当文件丢失处理(很久之前处理过Windows环境数据文件大小为 0 kb的问题,这几种情况都类似。)
这里我说一下简单的处理思路:
\1. 通过odu 扫盘,分别以不同offset方式来扫(0和4096)。
\2. 对比两次扫描结果,组合extent信息,抽取文件。
由于这里文件只有1个,大小20g左右,通过dd 拼接即可。
最终文件拼接完成后,由于这里是非归档环境,无法进行正常recover,因此还需要通过bbed来修改数据文件头的checkpoint信息。
对于文件系统来讲,目前已经不是Oracle存储的最佳选择了,建议使用ASM。当然,其他数据库比如MySQL、PostgreSQL除外。
以上就是良许教程网为各位朋友分享的Linux文件系统异常导致数据库文件无法访问。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你!