标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 kfed MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-01110 ORA-01555 ORA-01578 ORA-08103 ORA-600 2131 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (102)
- 数据库 (1,682)
- DB2 (22)
- MySQL (73)
- Oracle (1,544)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (159)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (7)
- Oracle ASM (67)
- Oracle Bug (8)
- Oracle RAC (53)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (565)
- Oracle安装升级 (92)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (79)
- PostgreSQL (18)
- PostgreSQL恢复 (6)
- SQL Server (27)
- SQL Server恢复 (8)
- TimesTen (7)
- 达梦数据库 (2)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (37)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (20)
-
最近发表
- 断电引起的ORA-08102: 未找到索引关键字, 对象号 39故障处理
- ORA-00227: corrupt block detected in control file
- 手工删除19c rac
- 解决oracle数据文件路径有回车故障
- .wstop扩展名勒索数据库恢复
- Oracle Recovery Tools工具一键解决ORA-00376 ORA-01110故障(文件offline)
- OGG-02771 Input trail file format RELEASE 19.1 is different from previous trail file form at RELEASE 11.2.
- OGG-02246 Source redo compatibility level 19.0.0 requires trail FORMAT 12.2 or higher
- GoldenGate 19安装和打patch
- dd破坏asm磁盘头恢复
- 删除asmlib磁盘导致磁盘组故障恢复
- Kylin Linux 安装19c
- ORA-600 krse_arc_complete.4
- Oracle 19c 202410补丁(RUs+OJVM)
- ntfs MFT损坏(ntfs文件系统故障)导致oracle异常恢复
- .mkp扩展名oracle数据文件加密恢复
- 清空redo,导致ORA-27048: skgfifi: file header information is invalid
- A_H_README_TO_RECOVER勒索恢复
- 通过alert日志分析客户自行对一个数据库恢复的来龙去脉和点评
- ORA-12514: TNS: 监听进程不能解析在连接描述符中给出的SERVICE_NAME
标签归档:OSD-04016
OSD-04016: 异步 I/O 请求排队时出错
有某客户由于硬件故障,导致数据库无法启动,让我们介入处理
数据库启动报错
Mon Feb 26 17:28:24 2018 ALTER DATABASE OPEN Beginning crash recovery of 1 threads parallel recovery started with 3 processes Started redo scan Completed redo scan read 2054 KB redo, 509 data blocks need recovery Started redo application at Thread 1: logseq 41341, block 54 Recovery of Online Redo Log: Thread 1 Group 1 Seq 41341 Reading mem 0 Mem# 0: E:\ORADATA\ORCL\REDO01.LOG Completed redo application of 1.77MB KCF: read, write or open error, block=0x16439 online=1 file=1 'E:\ORADATA\ORCL\SYSTEM01.DBF' error=27070 txt: 'OSD-04016: 异步 I/O 请求排队时出错。 O/S-Error: (OS 1) 函数不正确。' Errors in file d:\oracle\diag\rdbms\orcl\orcl\trace\orcl_dbw0_4928.trc: ORA-01243: system tablespace file suffered media failure ORA-01114: IO error writing block to file 1 (block # 91193) ORA-01110: data file 1: 'E:\ORADATA\ORCL\SYSTEM01.DBF' ORA-27070: async read/write failed OSD-04016: 异步 I/O 请求排队时出错。 O/S-Error: (OS 1) 函数不正确。 DBW0 (ospid: 4928): terminating the instance due to error 1243 Mon Feb 26 17:28:29 2018 Instance terminated by DBW0, pid = 4928
这里错误比较明显,由于io错误,在数据库实例恢复之时,写回block正好在该损坏位置从而使得数据库无法正常实例恢复,进而无法open.
dbv验证文件
通过专业工具对system文件进行了重构system文件,然后dbv检查结果如下
DBVERIFY: Release 11.2.0.1.0 - Production on 星期二 2月 27 17:20:14 2018 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. DBVERIFY - 开始验证: FILE = D:\OK\SYSTEM01.DBF 页 91156 标记为损坏 Corrupt block relative dba: 0x00416414 (file 1, block 91156) Bad header found during dbv: Data in bad block: type: 229 format: 6 rdba: 0xe1d9e3e7 last change scn: 0xd682.ffc8c7cb seq: 0x8c flg: 0x8c spare1: 0xc0 spare2: 0xf6 spare3: 0x70b3 consistency value in tail: 0x71f50602 check value in block header: 0x8195 computed block checksum: 0x8689 DBVERIFY - 验证完成 检查的页总数: 215040 处理的页总数 (数据): 178112 失败的页总数 (数据): 0 处理的页总数 (索引): 19070 失败的页总数 (索引): 0 处理的页总数 (其他): 3118 处理的总页数 (段) : 1 失败的总页数 (段) : 0 空的页总数: 14739 标记为损坏的总页数: 1 流入的页总数: 0 加密的总页数 : 0 最高块 SCN : 1638554501 (0.1638554501)
这里比较明显重构出来的system文件只有block 91156坏块,这里注意和没有处理之前的坏块不一样
通过dump分析坏块所属对象
Start dump data block from file D:\OK\SYSTEM01.DBF minblk 91156 maxblk 91156 V10 STYLE FILE HEADER: Compatibility Vsn = 186646528=0xb200000 Db ID=1383974140=0x527dc4fc, Db Name='ORCL' Activation ID=0=0x0 Control Seq=806694=0xc4f26, File size=215040=0x34800 File Number=1, Blksiz=8192, File Type=3 DATA Dump all the blocks in range: buffer tsn: 0 rdba: 0xe1d9e3e7 (903/1696743) scn: 0xd682.ffc8c7cb seq: 0x8c flg: 0x8c tail: 0x71f50602 frmt: 0x06 chkval: 0x8195 type: 0xe5=unknown Hex dump of corrupt header 4 = CORRUPT Start dump data block from file D:\OK\SYSTEM01.DBF minblk 91155 maxblk 91155 V10 STYLE FILE HEADER: Compatibility Vsn = 186646528=0xb200000 Db ID=1383974140=0x527dc4fc, Db Name='ORCL' Activation ID=0=0x0 Control Seq=806694=0xc4f26, File size=215040=0x34800 File Number=1, Blksiz=8192, File Type=3 DATA Dump all the blocks in range: buffer tsn: 0 rdba: 0x00416413 (1/91155) scn: 0x0000.613ad8d6 seq: 0x01 flg: 0x06 tail: 0xd8d60601 frmt: 0x02 chkval: 0xcc5f type: 0x06=trans data Hex dump of block: st=0, typ_found=1 Block header dump: 0x00416413 Object id on Block? Y seg/obj: 0x25 csc: 0x00.613ad8ce itc: 2 flg: - typ: 2 - INDEX fsl: 0 fnx: 0x0 ver: 0x01 Itl Xid Uba Flag Lck Scn/Fsc 0x01 0x0009.000.0016fda0 0x00c0130e.6f38.01 CB-- 0 scn 0x0000.3e6ed294 0x02 0x0009.008.0023e862 0x00c002cf.a217.13 --U- 1 fsc 0x0000.613ad8d6 Start dump data block from file D:\OK\SYSTEM01.DBF minblk 91157 maxblk 91157 V10 STYLE FILE HEADER: Compatibility Vsn = 186646528=0xb200000 Db ID=1383974140=0x527dc4fc, Db Name='ORCL' Activation ID=0=0x0 Control Seq=806694=0xc4f26, File size=215040=0x34800 File Number=1, Blksiz=8192, File Type=3 DATA Dump all the blocks in range: buffer tsn: 0 rdba: 0x00416415 (1/91157) scn: 0x0000.6193dc0c seq: 0x01 flg: 0x06 tail: 0xdc0c0601 frmt: 0x02 chkval: 0x8c21 type: 0x06=trans data Hex dump of block: st=0, typ_found=1 Block header dump: 0x00416415 Object id on Block? Y seg/obj: 0x25 csc: 0x00.6193dc04 itc: 2 flg: - typ: 2 - INDEX fsl: 0 fnx: 0x0 ver: 0x01 Itl Xid Uba Flag Lck Scn/Fsc 0x01 0x0006.00c.001ee103 0x00c008a5.8dbd.02 C--- 0 scn 0x0000.57303e03 0x02 0x000b.00f.00053100 0x00c008af.1563.09 --U- 1 fsc 0x0000.6193dc0c
这里比较明显,可以确定坏块为index,object_id=0×25=37,通过查询其他库,确定为i_obj2(obj$的index)
使用该文件启动数据库
SQL> alter database rename file 'E:\ORADATA\ORCL\SYSTEM01.DBF' to 'd:\orcl\SYSTEM01.DBF'; 数据库已更改。 SQL> recover database; 完成介质恢复。 SQL> alter database open; 数据库已更改。
检查alert日志
发现smon进程由于坏块的存储,出现大量报错,需要处理,不然数据库一段时间后就会crash.
Tue Feb 27 20:31:23 2018 QMNC started with pid=27, OS id=4652 Completed: alter database open Tue Feb 27 20:31:25 2018 Starting background process CJQ0 Tue Feb 27 20:31:25 2018 CJQ0 started with pid=30, OS id=2172 Tue Feb 27 20:31:25 2018 db_recovery_file_dest_size of 3912 MB is 0.00% used. This is a user-specified limit on the amount of space that will be used by this database for recovery-related files, and does not reflect the amount of space available in the underlying filesystem or ASM diskgroup. Hex dump of (file 1, block 91156) in trace file d:\oracle\diag\rdbms\orcl\orcl\trace\orcl_cjq0_2172.trc Corrupt block relative dba: 0x00416414 (file 1, block 91156) Bad header found during multiblock buffer read Data in bad block: type: 229 format: 6 rdba: 0xe1d9e3e7 last change scn: 0xd682.ffc8c7cb seq: 0x8c flg: 0x8c spare1: 0xc0 spare2: 0xf6 spare3: 0x70b3 consistency value in tail: 0x71f50602 check value in block header: 0x8195 computed block checksum: 0x8689 Reading datafile 'D:\ORCL\SYSTEM01.DBF' for corruption at rdba: 0x00416414 (file 1, block 91156) Reread (file 1, block 91156) found same corrupt data Errors in file d:\oracle\diag\rdbms\orcl\orcl\trace\orcl_smon_3992.trc (incident=77085): ORA-01578: ORACLE data block corrupted (file # 1, block # 91156) ORA-01110: data file 1: 'D:\ORCL\SYSTEM01.DBF' Incident details in: d:\oracle\diag\rdbms\orcl\orcl\incident\incdir_77085\orcl_smon_3992_i77085.trc Errors in file d:\oracle\diag\rdbms\orcl\orcl\trace\orcl_cjq0_2172.trc (incident=77221): ORA-01578: ORACLE data block corrupted (file # 1, block # 91156) ORA-01110: data file 1: 'D:\ORCL\SYSTEM01.DBF' Incident details in: d:\oracle\diag\rdbms\orcl\orcl\incident\incdir_77221\orcl_cjq0_2172_i77221.trc
重建i_obj2 index,参考://www.xifenfei.com/?p=5566
一次侥幸的OSD-04016 O/S-Error异常恢复
一台数据库因为异常断电导致硬盘IO出现O/S-Error: (OS 23) 数据错误(循环冗余检查)错误,使得datafile 6无法完成实例恢复.使用dbv检查该数据文件也出现类似错误,尝试copy该文件,也出现了类似的错误.尝试dd拷贝完整,发现dd也只能拷贝81951个block.
Tue May 14 15:32:10 2013 Completed redo scan 16941 redo blocks read, 1106 data blocks need recovery Tue May 14 15:32:17 2013 Errors in file d:\oracle\product\10.2.0\admin\water\bdump\water_p002_1472.trc: ORA-01115: IO error reading block from file 6 (block # 81951) ORA-01110: data file 6: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\WATER\YD_DATA01.DBF' ORA-27070: async read/write failed OSD-04016: 异步 I/O 请求排队时出错。 O/S-Error: (OS 23) 数据错误(循环冗余检查)。
因为该数据库有一天前的备份,而且他们只要求恢复其中三张核心表的数据,通过分析数据字典,确定出来相关表的block均不在block 81951之上,也就是说,如果数据库只是该block异常了,可以通过跳过该block,从而copy相关block,来实现数据库恢复,因为是一个文件的中间部分异常了,所以决定使用dd来copy文件正常部分
dd if=D:\ORACLE\PRODUCT\10.2.0\ORADATA\WATER\YD_DATA01.DBF bs=8192 count=81951 of=h:\dd\yd_data01_1.dbf dd if=D:\ORACLE\PRODUCT\10.2.0\ORADATA\WATER\YD_DATA01.DBF bs=8192 skip=81952 of=h:\dd\yd_data01_2.dbf
dd出来文件之后,因为我们跳过了block 81952(block 0 数据库为记录),所以我们需要通过dd来构造block 81952,并且把他们合并到一起
dd if=/dev/zero of=h:\dd\yd_data01_1.dbf seek=81951 bs=8192 count=1 dd if=h:\dd\yd_data01_2.dbf seek=81952 bs=8192 of=h:\dd\yd_data01_1.dbf
然后使用dul工具抽出来客户需要的三张核心表的数据,恢复工作算完成。
针对本次恢复,如果需求是open数据库,通过设置隐含参数,bbed之类原则上也可以实现.
这次的恢复算是比较侥幸:1.客户有一天前的exp,只需要恢复三张核心表数据;2.三张表的数据恰好都不在损坏的block中;3.数据库就损坏了一个block.
如果出现不幸情况,那可能需要先硬盘恢复,然后数据库恢复,最后折腾数据.
总之再次提醒各位:数据库备份很重要,很重要.对于需求是不能丢失数据的系统备份,一定要rman的方式备份,千万别选择exp/expdp