kfed修复损坏asm头部
Posted 久违的太阳
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了kfed修复损坏asm头部相关的知识,希望对你有一定的参考价值。
在11g之后,默认的asm会自动备份asm头部数据块(将数据块备份到第二个AU的倒数第二个数据块上),这样如果asm头部出现了问题,则可以使用kfed直接进行恢复(内部是用备份的数据块直接覆盖头部数据块)
[grid@db2 ~]$ kfod disk=all
--------------------------------------------------------------------------------
Disk Size Path User Group
================================================================================
1: 524288 Mb /dev/mapper/arch grid asmadmin
2: 1048576 Mb /dev/mapper/data grid asmadmin
3: 1048576 Mb /dev/mapper/data2 grid asmadmin
4: 2048 Mb /dev/mapper/ocr1 grid asmadmin
5: 2048 Mb /dev/mapper/ocr2 grid asmadmin
6: 2048 Mb /dev/mapper/ocr3 grid asmadmin
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME
================================================================================
+ASM2 /u01/11.2.0/grid
+ASM1 /u01/11.2.0/grid
[grid@db2 ~]$ kfed read /dev/mapper/data
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: blk=0
kfbh.block.obj: 0 ; 0x008: file=0
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
7F6DC79E5400 00000000 00000000 00000000 00000000 [................]
Repeat 26 times
7F6DC79E55B0 00000000 00000000 930C27AC 01000000 [.........'......]
7F6DC79E55C0 FE830001 003FFFFF D56B0000 00007FFF [......?...k.....]
7F6DC79E55D0 00000000 00000000 00000000 00000000 [................]
Repeat 1 times
7F6DC79E55F0 00000000 00000000 00000000 AA550000 [..............U.]
7F6DC79E5600 01040401 001ECA8C 00000000 00000002 [................]
7F6DC79E5610 80000000 001ECA8B 00000000 00020018 [................]
7F6DC79E5620 0042001C F99F0003 00480310 00000008 [..B.......H.....]
7F6DC79E5630 00000000 FFFFFFFF FFFFFFFF 00000000 [................]
7F6DC79E5640 00000002 80000001 001ECA8B 00000000 [................]
7F6DC79E5650 00020018 0041001C F99F0003 00080180 [......A.........]
7F6DC79E5660 00000008 00000000 00000003 00000052 [............R...]
7F6DC79E5670 00800000 0000003C 00000008 001ECA8B [....<...........]
7F6DC79E5680 00000000 003C0038 01E1001C F99F111A [....8.<.........]
7F6DC79E5690 00000000 00000000 00000000 0004CCA8 [................]
7F6DC79E56A0 00000000 00000000 00000000 00000001 [................]
7F6DC79E56B0 00000000 00000000 0000002A 00000000 [........*.......]
7F6DC79E56C0 00000000 00000000 00000032 00000000 [........2.......]
7F6DC79E56D0 80000000 00000003 001ECA8B 00000000 [................]
7F6DC79E56E0 00000010 00A1001C F99F110C 00160018 [................]
7F6DC79E56F0 00000001 0000002B 00000001 00000046 [....+.......F...]
7F6DC79E5700 001E0000 00000000 00000010 00A1001C [................]
7F6DC79E5710 F99F110C 00020018 00000001 00000021 [............!...]
7F6DC79E5720 0A000001 00000046 00000000 00000000 [....F...........]
7F6DC79E5730 00000000 00000000 00000000 00000000 [................]
Repeat 204 times
KFED-00322: Invalid content encountered during block traversal: [kfbtTraverseBlock][Invalid OSM block type][][0]
####这里显示文件头部错误
默认AU为1M的备份文件在510号数据块,可以用下面的命令查看:
[grid@db2 ~]$ kfed read /dev/mapper/data aun=0 blkn=510 | grep kfbh.type
下面进行修复:
[grid@db2 ~]$ kfed repair /dev/mapper/data
[grid@db2 ~]$ kfed read /dev/mapper/data
kfbh.endian: 1 ; 0x000: 0x01
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: blk=0
....
....
....
kfdhdb.ub4spare[51]: 0 ; 0x1c8: 0x00000000
kfdhdb.ub4spare[52]: 0 ; 0x1cc: 0x00000000
kfdhdb.ub4spare[53]: 0 ; 0x1d0: 0x00000000
kfdhdb.acdb.aba.seq: 0 ; 0x1d4: 0x00000000
kfdhdb.acdb.aba.blk: 0 ; 0x1d8: 0x00000000
kfdhdb.acdb.ents: 0 ; 0x1dc: 0x0000
kfdhdb.acdb.ub2spare: 0 ; 0x1de: 0x0000
需要注意的是,如果asm的au size不是默认的1MB,则需要从其它的位置
磁盘组头部备份的位置:
AU SIZE =1M备份块blkn=510
AU SIZE =2M备份块blkn=1022
AU SIZE =4M备份块blkn=2046
AU SIZE =8M备份块blkn=4094
AU SIZE =16M备份块blkn=8190
AU SIZE =32M备份块blkn=16382
AU SIZE =64M备份块blkn=32766
那么在repair的时候需要指定au的大小:
[grid@rac11g1 ~]$ kfed repair /dev/asm-data aus=2m
以上是关于kfed修复损坏asm头部的主要内容,如果未能解决你的问题,请参考以下文章
案例:Oracle非常规恢复 ASM磁盘组diskgroup被删除使用kfed进行完美恢复