这周折腾了2天的时间帮客户成功恢复了一套近1.4TB的10.2.0.5 RAC(ASM). 该库在3月4号直接crash了。
大家可以看到,该库在开始报错读取redo,controlfile报错,本质原因是DISKGROUP dismount了,信息如下:
Tue Mar 04 18:09:59 CST 2014
Errors in file /home/oraprod/10.2.0/db/admin/xxxx/bdump/xxxx_lgwr_15943.trc:
ORA-00345: redo log write error block 68145 count 5
ORA-00312: online log 6 thread 2: '+DATA/xxxx/onlinelog/o2_t2_redo3.log'
ORA-15078: ASM diskgroup was forcibly dismounted
Tue Mar 04 18:09:59 CST 2014
SUCCESS: diskgroup DATA was dismounted
SUCCESS: diskgroup DATA was dismounted
Tue Mar 04 18:10:00 CST 2014
Errors in file /home/oraprod/10.2.0/db/admin/xxxx/bdump/xxxx_lmon_15892.trc:
ORA-00202: control file: '+DATA/xxxx/controlfile/o1_mf_4g1zr1yo_.ctl'
ORA-15078: ASM diskgroup was forcibly dismounted
Tue Mar 04 18:10:00 CST 2014
KCF: write/open error block=0x1f41e online=1
file=31 +DATA/xxxx/datafile/apps_ts_queues.310.692585175
error=15078 txt: ''
Tue Mar 04 18:10:00 CST 2014
KCF: write/open error block=0x47d5d online=1
file=51 +DATA/xxx/datafile/apps_ts_tx_data.353.692593409
error=15078 txt: ''
Tue Mar 04 18:10:00 CST 2014
Errors in file /home/oraprod/10.2.0/db/admin/xxxx/bdump/xxxx_dbw2_15939.trc:
ORA-00202: control file: '+DATA/prod/controlfile/o1_mf_4g1zr1yo_.ctl'
ORA-15078: ASM diskgroup was forcibly dismounted
Tue Mar 04 18:10:00 CST 2014
KCF: write/open error block=0x47d5b online=1
file=51 +DATA/prod/datafile/apps_ts_tx_data.353.692593409
error=15078 txt: ''
Tue Mar 04 18:10:00 CST 2014
数据库实例挂了之后,我们来看下ASM实例的alert log信息,如下:
Tue Mar 04 18:10:04 CST 2014
NOTE: SMON starting instance recovery for group 1 (mounted)
Tue Mar 04 18:10:04 CST 2014
WARNING: IO Failed. au:0 diskname:/dev/raw/raw5
rq:0x200000000207b518 buffer:0x200000000235c600 au_offset(bytes):0 iosz:4096 operation:0
status:2
WARNING: IO Failed. au:0 diskname:/dev/raw/raw5
rq:0x200000000207b518 buffer:0x200000000235c600 au_offset(bytes):0 iosz:4096 operation:0
status:2
NOTE: F1X0 found on disk 0 fcn 0.160230519
WARNING: IO Failed. au:33 diskname:/dev/raw/raw5
rq:0x60000000002d64f0 buffer:0x400405df000 au_offset(bytes):0 iosz:4096 operation:0
status:2
WARNING: cache failed to read gn 1 fn 3 blk 10752 count 1 from disk 2
ERROR: cache failed to read fn=3 blk=10752 from disk(s): 2
ORA-15081: failed to submit an I/O operation to a disk
NOTE: cache initiating offline of disk 2 group 1
WARNING: process 12863 initiating offline of disk 2.2526420198 (DATA_0002) with mask 0x3 in group 1
NOTE: PST update: grp = 1, dsk = 2, mode = 0x6
Tue Mar 04 18:10:04 CST 2014
ERROR: too many offline disks in PST (grp 1)
Tue Mar 04 18:10:04 CST 2014
ERROR: PST-initiated MANDATORY DISMOUNT of group DATA
Tue Mar 04 18:10:04 CST 2014
WARNING: Disk 2 in group 1 in mode: 0x7,state: 0x2 was taken offline
Tue Mar 04 18:10:05 CST 2014
NOTE: halting all I/Os to diskgroup DATA
NOTE: active pin found: 0x0x40045bb0fd0
Tue Mar 04 18:10:05 CST 2014
Abort recovery for domain 1
Tue Mar 04 18:10:05 CST 2014
NOTE: cache dismounting group 1/0xD916EC16 (DATA)
Tue Mar 04 18:10:06 CST 2014
大家可以看到,ASM报了一个ORA-15081错误,在该错误之前是报对其中一个盘/dev/raw/raw5的IO操作错误。
细心的朋友可以看到,这里由于IO 操作异常后,该disk被offline了。最后磁盘组无法mount。
我们测试使用kfed read无法读取该disk,dd也无法操作。但是却可以直接dd 该disk对应的物理盘。
磁盘组无法mount,从其中trace来看显然是磁盘头损坏,如下:
WARNING: cache read a corrupted block gn=1 dsk=2 blk=1 from disk 2
OSM metadata block dump:
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 0 ; 0x001: 0x00
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
kfbh.datfmt: 0 ; 0x003: 0x00
kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
kfbh.block.obj: 0 ; 0x008: TYPE=0x0 NUMB=0x0
kfbh.check: 0 ; 0x00c: 0x00000000
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
CE: (0x0x400417ee4e0) group=1 (DATA) obj=2 (disk) blk=1
hashFlags=0x0002 lid=0x0002 lruFlags=0x0000 bastCount=1
redundancy=0x11 fileExtent=-2147483648 AUindex=0 blockIndex=1
copy #0: disk=2 au=0
BH: (0x0x40041795000) bnum=4586 type=reading state=reading chgSt=not modifying
flags=0x00000000 pinmode=excl lockmode=share bf=0x0x40041400000
kfbh_kfcbh.fcn_kfbh = 0.0 lowAba=655.8572 highAba=0.0
last kfcbInitSlot return code=null cpkt lnk is null
大家知道Oracle ASM 10.2.0.5版本开始会对ASM disk header 进行自动备份,如果如果仅仅是盘头
损坏那么恢复是很easy的。但是其实并不是这么简单,通过dd判断,该盘的前面几个block其实被损坏。
最后我们通过ODU 直接将数据文件从磁盘拷贝到文件系统,然后起库,最后完成整个恢复过程。
备注:在恢复过程中,发现ODU无法直接拷贝test201402.dbf 这样的文件,然而通过检查
asm alias directory发现,其实是完好的,这里可能odu处理还有点小问题,我们通过手工将该元数据
的AU 读取出来,然后匹配将剩下的文件全部抽取出来了,包括redo,controlfile,直接顺利打开数据库。
不得不说,熊哥的ODU太强大了,秒杀各种Oracle ASM的数据库恢复Case!