Oracle 10g rac asm磁盘头备份与恢复实验

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:3962

本帖最后由 paulyi 于 2014-2-23 18:12 编辑

Oracle 10g rac asm 磁盘头备份与恢复实验

一、实验目的:
我们经常由于误操作,比如对disk做了pvid=yes的操作,导致磁盘组的磁盘头信息丢失,从而不能正常
mount,导致数据库起不来,从而影响业务。以下实验就是为了解决上面情况,而提供的解决方法。

二、实验环境:
操作系统:AIX 6.1
数据库版本:oracle 10.2.0.4 + rac + asm
数据库名:test
实例名:test1、test2
ip地址:(p520)192.168.3.225/(p650)192.168.3.223

三、实验步骤:
1、生成kfed工具和读取磁盘头信息:
1)编译kfed,生成kfed工具:
cd $ORACLE_HOME/rdbms/lib
cp ins_rdbms.mk ins_rdbms.mk.bak
[make -f ins_rdbms.mk ikfed]
Linking KFED utility (kfed)
rm -f /oracle/app/oracle/product/10.2.0/clusterdb/rdbms/lib/kfed
ld -b64 -o /oracle/app/oracle/product/10.2.0/clusterdb/rdbms/lib/kfed -
L/oracle/app/oracle/product/10.2.0/clusterdb/rdbms/lib/ -
L/oracle/app/oracle/product/10.2.0/clusterdb/lib/ -bnoerrmsg
/oracle/app/oracle/product/10.2.0/clusterdb/lib/s0main.o
/oracle/app/oracle/product/10.2.0/clusterdb/rdbms/lib/sskfeded.o
/oracle/app/oracle/product/10.2.0/clusterdb/rdbms/lib/skfedpt.o -bI:/usr/lib/aio.exp
/oracle/app/oracle/product/10.2.0/clusterdb/rdbms/lib/defopt.o -ldbtools10 `cat
/oracle/app/oracle/product/10.2.0/clusterdb/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -
lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat
/oracle/app/oracle/product/10.2.0/clusterdb/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -
lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lmm -
lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -
lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat
/oracle/app/oracle/product/10.2.0/clusterdb/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -
lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat
/oracle/app/oracle/product/10.2.0/clusterdb/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -
lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lpls10
-lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -
lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -
lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10
-lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lld -lm `cat
/oracle/app/oracle/product/10.2.0/clusterdb/lib/sysliblist` -lm `if [ "`/usr/bin/uname -
v`" = "4" ];
then echo "-bI:/oracle/app/oracle/product/10.2.0/clusterdb/lib/pw-syscall.exp"; fi;`
-lsql10 /oracle/app/oracle/product/10.2.0/clusterdb/lib/nautab.o
/oracle/app/oracle/product/10.2.0/clusterdb/lib/naeet.o
/oracle/app/oracle/product/10.2.0/clusterdb/lib/naect.o
/oracle/app/oracle/product/10.2.0/clusterdb/lib/naedhs.o
mv -f /oracle/app/oracle/product/10.2.0/clusterdb/bin/kfed
/oracle/app/oracle/product/10.2.0/clusterdb/bin/kfedO
mv /oracle/app/oracle/product/10.2.0/clusterdb/rdbms/lib/kfed
/oracle/app/oracle/product/10.2.0/clusterdb/bin/kfed
chmod 751 /oracle/app/oracle/product/10.2.0/clusterdb/bin/kfed

2)查看磁盘组下的磁盘信息:
[oracle@p520:/]$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 27 10:19:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> col name format a30
SQL> col path format a30
SQL> select name,path from v$asm_disk;
NAME PATH
------------------------------ -----------------------
DATA_0000 /dev/rhdisk5
DATA_0001 /dev/rhdisk3
SQL> select name ,state from v$asm_diskgroup;
NAME STATE
------------------------------ ----------------------
DATA MOUNTED
SQL> /
NAME PATH HEADER_STATUS
------------------------------ ------------------------------ ---------------
DATA_0000 /dev/rhdisk5 MEMBER
DATA_0001 /dev/rhdisk3 MEMBER

3)用kfed工具读取磁盘头信息:
比如读取磁盘组data下hdisk5磁盘头信息
[oracle@p520:/]$kfed read /dev/rhdisk5
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
kfbh.check: 257017006 ; 0x00c: 0x0f51c4ae
kfbh.fcn.base: 578 ; 0x010: 0x00000242
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8
kfdhdb.driver.reserved[0]: 0 ; 0x008: 0x00000000
kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000
kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
kfdhdb.dsknum: 0 ; 0x024: 0x0000
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname: DATA_0000 ; 0x028: length=9
kfdhdb.grpname: DATA ; 0x048: length=4
kfdhdb.fgname: DATA_0000 ; 0x068: length=9
kfdhdb.capname: ; 0x088: length=0
kfdhdb.crestmp.hi: 32937833 ; 0x0a8: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo: 1704514560 ; 0x0ac: USEC=0x0 MSEC=0x235 SECS=0x19 MINS=0x19
kfdhdb.mntstmp.hi: 32937834 ; 0x0b0: HOUR=0xa DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.mntstmp.lo: 679906304 ; 0x0b4: USEC=0x0 MSEC=0x1a3 SECS=0x8 MINS=0xa
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: 51200 ; 0x0c4: 0x0000c800
kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001
kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002
kfdhdb.redomirrors[0]: 0 ; 0x0d8: 0x0000
kfdhdb.redomirrors[1]: 65535 ; 0x0da: 0xffff
kfdhdb.redomirrors[2]: 65535 ; 0x0dc: 0xffff
kfdhdb.redomirrors[3]: 65535 ; 0x0de: 0xffff
kfdhdb.dbcompat: 168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi: 32937833 ; 0x0e4: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.grpstmp.lo: 1704339456 ; 0x0e8: USEC=0x0 MSEC=0x18a SECS=0x19 MINS=0x19
kfdhdb.ub4spare[0]: 0 ; 0x0ec: 0x00000000
kfdhdb.ub4spare[1]: 0 ; 0x0f0: 0x00000000
kfdhdb.ub4spare[2]: 0 ; 0x0f4: 0x00000000
kfdhdb.ub4spare[3]: 0 ; 0x0f8: 0x00000000
kfdhdb.ub4spare[4]: 0 ; 0x0fc: 0x00000000
kfdhdb.ub4spare[5]: 0 ; 0x100: 0x00000000
kfdhdb.ub4spare[6]: 0 ; 0x104: 0x00000000
kfdhdb.ub4spare[7]: 0 ; 0x108: 0x00000000
kfdhdb.ub4spare[8]: 0 ; 0x10c: 0x00000000
kfdhdb.ub4spare[9]: 0 ; 0x110: 0x00000000
kfdhdb.ub4spare[10]: 0 ; 0x114: 0x00000000
kfdhdb.ub4spare[11]: 0 ; 0x118: 0x00000000
kfdhdb.ub4spare[12]: 0 ; 0x11c: 0x00000000
kfdhdb.ub4spare[13]: 0 ; 0x120: 0x00000000
kfdhdb.ub4spare[14]: 0 ; 0x124: 0x00000000
kfdhdb.ub4spare[15]: 0 ; 0x128: 0x00000000
kfdhdb.ub4spare[16]: 0 ; 0x12c: 0x00000000
kfdhdb.ub4spare[17]: 0 ; 0x130: 0x00000000
kfdhdb.ub4spare[18]: 0 ; 0x134: 0x00000000
kfdhdb.ub4spare[19]: 0 ; 0x138: 0x00000000
kfdhdb.ub4spare[20]: 0 ; 0x13c: 0x00000000
kfdhdb.ub4spare[21]: 0 ; 0x140: 0x00000000
kfdhdb.ub4spare[22]: 0 ; 0x144: 0x00000000
kfdhdb.ub4spare[23]: 0 ; 0x148: 0x00000000
kfdhdb.ub4spare[24]: 0 ; 0x14c: 0x00000000
kfdhdb.ub4spare[25]: 0 ; 0x150: 0x00000000
kfdhdb.ub4spare[26]: 0 ; 0x154: 0x00000000
kfdhdb.ub4spare[27]: 0 ; 0x158: 0x00000000
kfdhdb.ub4spare[28]: 0 ; 0x15c: 0x00000000
kfdhdb.ub4spare[29]: 0 ; 0x160: 0x00000000
kfdhdb.ub4spare[30]: 0 ; 0x164: 0x00000000
kfdhdb.ub4spare[31]: 0 ; 0x168: 0x00000000
kfdhdb.ub4spare[32]: 0 ; 0x16c: 0x00000000
kfdhdb.ub4spare[33]: 0 ; 0x170: 0x00000000
kfdhdb.ub4spare[34]: 0 ; 0x174: 0x00000000
kfdhdb.ub4spare[35]: 0 ; 0x178: 0x00000000
kfdhdb.ub4spare[36]: 0 ; 0x17c: 0x00000000
kfdhdb.ub4spare[37]: 0 ; 0x180: 0x00000000
kfdhdb.ub4spare[38]: 0 ; 0x184: 0x00000000
kfdhdb.ub4spare[39]: 0 ; 0x188: 0x00000000
kfdhdb.ub4spare[40]: 0 ; 0x18c: 0x00000000
kfdhdb.ub4spare[41]: 0 ; 0x190: 0x00000000
kfdhdb.ub4spare[42]: 0 ; 0x194: 0x00000000
kfdhdb.ub4spare[43]: 0 ; 0x198: 0x00000000
kfdhdb.ub4spare[44]: 0 ; 0x19c: 0x00000000
kfdhdb.ub4spare[45]: 0 ; 0x1a0: 0x00000000
kfdhdb.ub4spare[46]: 0 ; 0x1a4: 0x00000000
kfdhdb.ub4spare[47]: 0 ; 0x1a8: 0x00000000
kfdhdb.ub4spare[48]: 0 ; 0x1ac: 0x00000000
kfdhdb.ub4spare[49]: 0 ; 0x1b0: 0x00000000
kfdhdb.ub4spare[50]: 0 ; 0x1b4: 0x00000000
kfdhdb.ub4spare[51]: 0 ; 0x1b8: 0x00000000
kfdhdb.ub4spare[52]: 0 ; 0x1bc: 0x00000000
kfdhdb.ub4spare[53]: 0 ; 0x1c0: 0x00000000
kfdhdb.ub4spare[54]: 0 ; 0x1c4: 0x00000000
kfdhdb.ub4spare[55]: 0 ; 0x1c8: 0x00000000
kfdhdb.ub4spare[56]: 0 ; 0x1cc: 0x00000000
kfdhdb.ub4spare[57]: 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
从上面读出的内容,我们可以获取以下信息:
dsknum:磁盘号
grptyp:磁盘所属类型EXTERNAL REDUNDANCY

磁盘所属类型主要有:
NORMAL REDUNDANCY - Two-way mirroring, requiring two failure groups.
HIGH REDUNDANCY - Three-way mirroring, requiring three failure groups.
EXTERNAL REDUNDANCY - No mirroring for disks that are already protected using hardware
mirroring or RAID.
ddrsts:磁盘头状态
dskname:在asm中磁盘名
grpname:磁盘组名
fgname:failure group name
crestmp.hi:asm磁盘组创建时间
mntstmp.hi:asm磁盘组mount时间
blksize:磁盘头块大小 4096
ausize:条带化大小 默认1M
dsksize:磁盘大小
f1b1locn:File Directory blk 1 AU num
Beginging for file directory

2、磁盘头有使用dd备份下的恢复:
1)使用dd备份:
因为磁盘头信息只占用最前面4k内容,所以我们可以用dd只备份前面4k内容:
[oracle@p520:/]$dd if=/dev/rhdisk5 f=/oracle/hdisk5header bs=4096 count=1
1+0 records in.
1+0 records out.
[oracle@p520:/]$dd if=/dev/rhdisk3 f=/oracle/hdisk3header bs=4096 count=1
1+0 records in.
1+0 records out.

2)使用dd恢复:

dd破坏hdisk5 磁盘头信息
[oracle@p520:/oracle]$dd if=/dev/zero f=/dev/rhdisk5 bs=4096 count=1
1+0 records in.
1+0 records out.

损坏磁盘头信息如下:
[oracle@p520:/oracle]$kfed read /dev/rhdisk5
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

可以看到,磁盘头相关信息丢失。
asm实例启动时报以下错误信息:
SQL> startup
ASM instance started
Total System Global Area 130023424 bytes
Fixed Size 2019136 bytes
Variable Size 102838464 bytes
ASM Cache 25165824 bytes
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"
SQL> select name,state from v$asm_diskgroup;
NAME STATE
----------- -------------
DATA DISMOUNTED
SQL> alter diskgroup data mount;
alter diskgroup data mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"

Asm实例日志记录以下内容:
Thu May 27 11:00:03 2010
ERROR: no PST quorum in group 1: required 1, found 0
Thu May 27 11:00:03 2010
NOTE: cache dismounting group 1/0x1E9B7FD5 (DATA)
NOTE: dbwr not being msg'd to dismount
ERROR: diskgroup DATA was not mounted

使用dd进行恢复:
[oracle@p520:/oracle]$dd if=/oracle/hdisk5header f=/dev/rhdisk5 bs=4096 count=1
1+0 records in.
1+0 records out.

这时可以正常读取磁盘头信息:
[oracle@p520:/oracle]$kfed read /dev/rhdisk5
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
kfbh.check: 257017006 ; 0x00c: 0x0f51c4ae
kfbh.fcn.base: 578 ; 0x010: 0x00000242
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8
kfdhdb.driver.reserved[0]: 0 ; 0x008: 0x00000000
kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000
kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
kfdhdb.dsknum: 0 ; 0x024: 0x0000
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname: DATA_0000 ; 0x028: length=9
kfdhdb.grpname: DATA ; 0x048: length=4
kfdhdb.fgname: DATA_0000 ; 0x068: length=9
kfdhdb.capname: ; 0x088: length=0
kfdhdb.crestmp.hi: 32937833 ; 0x0a8: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo: 1704514560 ; 0x0ac: USEC=0x0 MSEC=0x235 SECS=0x19 MINS=0x19
kfdhdb.mntstmp.hi: 32937834 ; 0x0b0: HOUR=0xa DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.mntstmp.lo: 679906304 ; 0x0b4: USEC=0x0 MSEC=0x1a3 SECS=0x8 MINS=0xa
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: 51200 ; 0x0c4: 0x0000c800
kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001
kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002
kfdhdb.redomirrors[0]: 0 ; 0x0d8: 0x0000
kfdhdb.redomirrors[1]: 65535 ; 0x0da: 0xffff
kfdhdb.redomirrors[2]: 65535 ; 0x0dc: 0xffff
kfdhdb.redomirrors[3]: 65535 ; 0x0de: 0xffff
kfdhdb.dbcompat: 168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi: 32937833 ; 0x0e4: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.grpstmp.lo: 1704339456 ; 0x0e8: USEC=0x0 MSEC=0x18a SECS=0x19 MINS=0x19
kfdhdb.ub4spare[0]: 0 ; 0x0ec: 0x00000000
kfdhdb.ub4spare[1]: 0 ; 0x0f0: 0x00000000
kfdhdb.ub4spare[2]: 0 ; 0x0f4: 0x00000000
kfdhdb.ub4spare[3]: 0 ; 0x0f8: 0x00000000
kfdhdb.ub4spare[4]: 0 ; 0x0fc: 0x00000000
kfdhdb.ub4spare[5]: 0 ; 0x100: 0x00000000
kfdhdb.ub4spare[6]: 0 ; 0x104: 0x00000000
kfdhdb.ub4spare[7]: 0 ; 0x108: 0x00000000
kfdhdb.ub4spare[8]: 0 ; 0x10c: 0x00000000
kfdhdb.ub4spare[9]: 0 ; 0x110: 0x00000000
kfdhdb.ub4spare[10]: 0 ; 0x114: 0x00000000
kfdhdb.ub4spare[11]: 0 ; 0x118: 0x00000000
kfdhdb.ub4spare[12]: 0 ; 0x11c: 0x00000000
kfdhdb.ub4spare[13]: 0 ; 0x120: 0x00000000
kfdhdb.ub4spare[14]: 0 ; 0x124: 0x00000000
kfdhdb.ub4spare[15]: 0 ; 0x128: 0x00000000
kfdhdb.ub4spare[16]: 0 ; 0x12c: 0x00000000
kfdhdb.ub4spare[17]: 0 ; 0x130: 0x00000000
kfdhdb.ub4spare[18]: 0 ; 0x134: 0x00000000
kfdhdb.ub4spare[19]: 0 ; 0x138: 0x00000000
kfdhdb.ub4spare[20]: 0 ; 0x13c: 0x00000000
kfdhdb.ub4spare[21]: 0 ; 0x140: 0x00000000
kfdhdb.ub4spare[22]: 0 ; 0x144: 0x00000000
kfdhdb.ub4spare[23]: 0 ; 0x148: 0x00000000
kfdhdb.ub4spare[24]: 0 ; 0x14c: 0x00000000
kfdhdb.ub4spare[25]: 0 ; 0x150: 0x00000000
kfdhdb.ub4spare[26]: 0 ; 0x154: 0x00000000
kfdhdb.ub4spare[27]: 0 ; 0x158: 0x00000000
kfdhdb.ub4spare[28]: 0 ; 0x15c: 0x00000000
kfdhdb.ub4spare[29]: 0 ; 0x160: 0x00000000
kfdhdb.ub4spare[30]: 0 ; 0x164: 0x00000000
kfdhdb.ub4spare[31]: 0 ; 0x168: 0x00000000
kfdhdb.ub4spare[32]: 0 ; 0x16c: 0x00000000
kfdhdb.ub4spare[33]: 0 ; 0x170: 0x00000000
kfdhdb.ub4spare[34]: 0 ; 0x174: 0x00000000
kfdhdb.ub4spare[35]: 0 ; 0x178: 0x00000000
kfdhdb.ub4spare[36]: 0 ; 0x17c: 0x00000000
kfdhdb.ub4spare[37]: 0 ; 0x180: 0x00000000
kfdhdb.ub4spare[38]: 0 ; 0x184: 0x00000000
kfdhdb.ub4spare[39]: 0 ; 0x188: 0x00000000
kfdhdb.ub4spare[40]: 0 ; 0x18c: 0x00000000
kfdhdb.ub4spare[41]: 0 ; 0x190: 0x00000000
kfdhdb.ub4spare[42]: 0 ; 0x194: 0x00000000
kfdhdb.ub4spare[43]: 0 ; 0x198: 0x00000000
kfdhdb.ub4spare[44]: 0 ; 0x19c: 0x00000000
kfdhdb.ub4spare[45]: 0 ; 0x1a0: 0x00000000
kfdhdb.ub4spare[46]: 0 ; 0x1a4: 0x00000000
kfdhdb.ub4spare[47]: 0 ; 0x1a8: 0x00000000
kfdhdb.ub4spare[48]: 0 ; 0x1ac: 0x00000000
kfdhdb.ub4spare[49]: 0 ; 0x1b0: 0x00000000
kfdhdb.ub4spare[50]: 0 ; 0x1b4: 0x00000000
kfdhdb.ub4spare[51]: 0 ; 0x1b8: 0x00000000
kfdhdb.ub4spare[52]: 0 ; 0x1bc: 0x00000000
kfdhdb.ub4spare[53]: 0 ; 0x1c0: 0x00000000
kfdhdb.ub4spare[54]: 0 ; 0x1c4: 0x00000000
kfdhdb.ub4spare[55]: 0 ; 0x1c8: 0x00000000
kfdhdb.ub4spare[56]: 0 ; 0x1cc: 0x00000000
kfdhdb.ub4spare[57]: 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
磁盘组可以正常mount:
SQL> alter diskgroup data mount;
Diskgroup altered.

SQL> select name,state from v$asm_diskgroup;
NAME STATE
------ ----------
DATA MOUNTED

3、磁盘头有使用kfed备份下的恢复:
1)使用kfed备份磁盘头信息:
[oracle@p520:/oracle]$kfed read /dev/rhdisk5 > /oracle/hdisk5backup.txt
[oracle@p520:/oracle]$kfed read /dev/rhdisk3 > /oracle/hdisk3backup.txt
-rw-r--r-- 1 oracle oinstall 6607 May 27 11:11 hdisk5backup.txt
-rw-r--r-- 1 oracle oinstall 6607 May 27 11:11 hdisk3backup.txt

2)使用kfed恢复:
使用dd破坏file directory即hdisk5磁盘头信息
[oracle@p520:/oracle]$dd if=/dev/zero f=/dev/rhdisk5 bs=4096 count=1
1+0 records in.
1+0 records out.
SQL> alter diskgroup data mount;
alter diskgroup data mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA";

因为hdisk5是file directory,所以报上面错误信息,如果是hdisk3磁盘头损坏,则报:
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk "1" is missing
恢复用kfed merge命令
[oracle@p520:/oracle]$kfed merge /dev/rhdisk5 text=/oracle/hdisk5backup.txt

SQL> alter diskgroup data mount;
Diskgroup alter

使用dd破坏hdisk3磁盘头信息
[oracle@p520:/oracle]$dd if=/dev/zero f=/dev/rhdisk3 bs=4096 count=1
1+0 records in.
1+0 records out.
SQL> alter diskgroup data mount;
alter diskgroup data mount
*
SQL> alter diskgroup data mount;
alter diskgroup data mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk "1" is missing
恢复用kfed merge命令
[oracle@p520:/oracle]$kfed merge /dev/rhdisk3 text=/oracle/hdisk3backup.txt

SQL> alter diskgroup data mount;
Diskgroup altere

4、磁盘头没有进行备份,但不是file directory磁盘头的信息丢失的恢复:
1)首先确定磁盘是否为file directory盘;如果我们确定hdisk5 是file directory盘。
2)破坏非file directory盘hdisk3头信息:
破坏hdisk3磁盘头:
[oracle@p520:/oracle]$dd if=/dev/zero f=/dev/rhdisk3 bs=4096 count=1
1+0 records in.
1+0 records out.
[oracle@p520:/oracle]$kfed read /dev/rhdisk3
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
检查diskgroup
SQL> alter diskgroup data mount;
alter diskgroup data mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk "1" is missing

3)根据file directory hdisk5查找disk directory信息;可以用select name,path from v$asm_disk查
出。

4)根据disk directory hdisk3找出磁盘信息;从里面可以得到hdisk3磁盘信息
kfddde[1].dsknum: 1 ; 0x1f4: 0x0001
kfddde[1].dskname: DATA_0001 ; 0x1f8: length=9
kfddde[1].fgname: DATA_0001 ; 0x218: length=9
kfddde[1].crestmp.hi: 32937837 ; 0x238: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfddde[1].crestmp.lo: 1899649024 ; 0x23c: USEC=0x0 MSEC=0x296 SECS=0x13 MINS=0x1c
kfddde[1].size: 1024 ; 0x24c: 0x00000400

5)根据以上信息生成恢复hdisk3磁盘头文件:
这里我们可以用hdisk5来修改:
kfed read /dev/rhdisk5 > /oracle/hdisk5.txt
kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
kfdhdb.dsknum: 0; 0x024: 0x0000
kfdhdb.dskname: DATA_0000 ; 0x028: length=9
kfdhdb.fgname: DATA_0000 ; 0x068: length=9
kfdhdb.crestmp.hi: 32937833 ; 0x0a8: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo: 1704514560 ; 0x0ac: USEC=0x0 MSEC=0x235 SECS=0x19 MINS=0x19
kfdhdb.dsksize: 51200 ; 0x0c4: 0x0000c800

将上面值修改为以下值:
kfbh.block.obj: 2147483649 ; 0x008: TYPE=0x8 NUMB=0x0
kfdhdb.dsknum: 1 ; 0x024: 0x0000
kfdhdb.dskname: DATA_0001 ; 0x028: length=9
kfdhdb.fgname: DATA_0001 ; 0x068: length=9
kfdhdb.crestmp.hi: 32937837 ; 0x0a8: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo: 1899649024; 0x0ac: USEC=0x0 MSEC=0x235 SECS=0x19 MINS=0x19
kfdhdb.dsksize: 1024 ; 0x0c4: 0x0000c800

这个最好用ultraedit编辑,生成hdisk3.txt;
kfed merge进去头文件信息到hdisk3:
[oracle@p520:/oracle]$kfed merge /dev/rhdisk3 text=/oracle/hdisk3.txt

验证是否修复成功:
SQL> alter diskgroup data mount;
Diskgroup altered.

并且能够正确读取磁盘头信息:
[oracle@p520:/oracle]$kfed read /dev/rhdisk3
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
kfbh.block.obj: 2147483649 ; 0x008: TYPE=0x8 NUMB=0x1
kfbh.check: 3781987247 ; 0x00c: 0xe16c8baf
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8
kfdhdb.driver.reserved[0]: 0 ; 0x008: 0x00000000
kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000
kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
kfdhdb.dsknum: 1 ; 0x024: 0x0001
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname: DATA_0001 ; 0x028: length=9
kfdhdb.grpname: DATA ; 0x048: length=4
kfdhdb.fgname: DATA_0001 ; 0x068: length=9
kfdhdb.capname: ; 0x088: length=0
kfdhdb.crestmp.hi: 32937837 ; 0x0a8: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo: 1899649024 ; 0x0ac: USEC=0x0 MSEC=0x296 SECS=0x13 MINS=0x1c
kfdhdb.mntstmp.hi: 32937834 ; 0x0b0: HOUR=0xa DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.mntstmp.lo: 679906304 ; 0x0b4: USEC=0x0 MSEC=0x1a3 SECS=0x8 MINS=0xa
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: 1024 ; 0x0c4: 0x00000400
kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001
kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn: 0 ; 0x0d4: 0x00000000
kfdhdb.redomirrors[0]: 0 ; 0x0d8: 0x0000
kfdhdb.redomirrors[1]: 0 ; 0x0da: 0x0000
kfdhdb.redomirrors[2]: 0 ; 0x0dc: 0x0000
kfdhdb.redomirrors[3]: 0 ; 0x0de: 0x0000
kfdhdb.dbcompat: 168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi: 32937833 ; 0x0e4: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.grpstmp.lo: 1704339456 ; 0x0e8: USEC=0x0 MSEC=0x18a SECS=0x19 MINS=0x19
kfdhdb.ub4spare[0]: 0 ; 0x0ec: 0x00000000
kfdhdb.ub4spare[1]: 0 ; 0x0f0: 0x00000000
kfdhdb.ub4spare[2]: 0 ; 0x0f4: 0x00000000
kfdhdb.ub4spare[3]: 0 ; 0x0f8: 0x00000000
kfdhdb.ub4spare[4]: 0 ; 0x0fc: 0x00000000
kfdhdb.ub4spare[5]: 0 ; 0x100: 0x00000000
kfdhdb.ub4spare[6]: 0 ; 0x104: 0x00000000
kfdhdb.ub4spare[7]: 0 ; 0x108: 0x00000000
kfdhdb.ub4spare[8]: 0 ; 0x10c: 0x00000000
kfdhdb.ub4spare[9]: 0 ; 0x110: 0x00000000
kfdhdb.ub4spare[10]: 0 ; 0x114: 0x00000000
kfdhdb.ub4spare[11]: 0 ; 0x118: 0x00000000
kfdhdb.ub4spare[12]: 0 ; 0x11c: 0x00000000
kfdhdb.ub4spare[13]: 0 ; 0x120: 0x00000000
kfdhdb.ub4spare[14]: 0 ; 0x124: 0x00000000
kfdhdb.ub4spare[15]: 0 ; 0x128: 0x00000000
kfdhdb.ub4spare[16]: 0 ; 0x12c: 0x00000000
kfdhdb.ub4spare[17]: 0 ; 0x130: 0x00000000
kfdhdb.ub4spare[18]: 0 ; 0x134: 0x00000000
kfdhdb.ub4spare[19]: 0 ; 0x138: 0x00000000
kfdhdb.ub4spare[20]: 0 ; 0x13c: 0x00000000
kfdhdb.ub4spare[21]: 0 ; 0x140: 0x00000000
kfdhdb.ub4spare[22]: 0 ; 0x144: 0x00000000
kfdhdb.ub4spare[23]: 0 ; 0x148: 0x00000000
kfdhdb.ub4spare[24]: 0 ; 0x14c: 0x00000000
kfdhdb.ub4spare[25]: 0 ; 0x150: 0x00000000
kfdhdb.ub4spare[26]: 0 ; 0x154: 0x00000000
kfdhdb.ub4spare[27]: 0 ; 0x158: 0x00000000
kfdhdb.ub4spare[28]: 0 ; 0x15c: 0x00000000
kfdhdb.ub4spare[29]: 0 ; 0x160: 0x00000000
kfdhdb.ub4spare[30]: 0 ; 0x164: 0x00000000
kfdhdb.ub4spare[31]: 0 ; 0x168: 0x00000000
kfdhdb.ub4spare[32]: 0 ; 0x16c: 0x00000000
kfdhdb.ub4spare[33]: 0 ; 0x170: 0x00000000
kfdhdb.ub4spare[34]: 0 ; 0x174: 0x00000000
kfdhdb.ub4spare[35]: 0 ; 0x178: 0x00000000
kfdhdb.ub4spare[36]: 0 ; 0x17c: 0x00000000
kfdhdb.ub4spare[37]: 0 ; 0x180: 0x00000000
kfdhdb.ub4spare[38]: 0 ; 0x184: 0x00000000
kfdhdb.ub4spare[39]: 0 ; 0x188: 0x00000000
kfdhdb.ub4spare[40]: 0 ; 0x18c: 0x00000000
kfdhdb.ub4spare[41]: 0 ; 0x190: 0x00000000
kfdhdb.ub4spare[42]: 0 ; 0x194: 0x00000000
kfdhdb.ub4spare[43]: 0 ; 0x198: 0x00000000
kfdhdb.ub4spare[44]: 0 ; 0x19c: 0x00000000
kfdhdb.ub4spare[45]: 0 ; 0x1a0: 0x00000000
kfdhdb.ub4spare[46]: 0 ; 0x1a4: 0x00000000
kfdhdb.ub4spare[47]: 0 ; 0x1a8: 0x00000000
kfdhdb.ub4spare[48]: 0 ; 0x1ac: 0x00000000
kfdhdb.ub4spare[49]: 0 ; 0x1b0: 0x00000000
kfdhdb.ub4spare[50]: 0 ; 0x1b4: 0x00000000
kfdhdb.ub4spare[51]: 0 ; 0x1b8: 0x00000000
kfdhdb.ub4spare[52]: 0 ; 0x1bc: 0x00000000
kfdhdb.ub4spare[53]: 0 ; 0x1c0: 0x00000000
kfdhdb.ub4spare[54]: 0 ; 0x1c4: 0x00000000
kfdhdb.ub4spare[55]: 0 ; 0x1c8: 0x00000000
kfdhdb.ub4spare[56]: 0 ; 0x1cc: 0x00000000
kfdhdb.ub4spare[57]: 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
修复成功。

5、磁盘组file directory所在的磁盘头信息丢失恢复:
1)破坏hdisk5磁盘头:
[oracle@p520:/oracle]$dd if=/dev/zero f=/dev/rhdisk5 bs=4096 count=1
1+0 records in.
1+0 records out.
[oracle@p520:/oracle]$kfed read /dev/rhdisk5
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
检查diskgroup:
SQL> alter diskgroup data mount;
alter diskgroup data mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"

2)根据file directory hdisk5查找disk directory信息:
可以用select name,path from v$asm_disk查出。

3)根据disk directory hdisk3找出磁盘信息;里面可以得到以下hdisk5的磁盘头信息;
kfddde[0].dsknum: 0 ; 0x034: 0x0000
kfddde[0].dskname: DATA_0000 ; 0x038: length=9
kfddde[0].fgname: DATA_0000 ; 0x058: length=9
kfddde[0].crestmp.hi: 32937833 ; 0x078: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfddde[0].crestmp.lo: 1704514560 ; 0x07c: USEC=0x0 MSEC=0x235 SECS=0x19 MINS=0x19
kfddde[0].size: 51200 ; 0x08c: 0x0000c800

4)根据info.txt信息生成恢复hdisk5磁盘头文件:
这里我们可以用hdisk3磁盘头信息文件来修改:
kfed read /dev/rhdisk3 > /oracle/hdisk3.txt
kfbh.block.obj: 2147483649 ; 0x008: TYPE=0x8 NUMB=0x1
kfdhdb.dsknum: 1; 0x024: 0x0001
kfdhdb.dskname: DATA_0001 ; 0x028: length=9
kfdhdb.fgname: DATA_0001 ; 0x068: length=9
kfdhdb.crestmp.hi: 32937833 ; 0x0a8: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo: 1704514560 ; 0x0ac: USEC=0x0 MSEC=0x235 SECS=0x19 MINS=0x19
kfdhdb.dsksize: 1024 ; 0x0c4: 0x0000c800

将上面值修改为以下值:
kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
kfdhdb.dsknum: 0 ; 0x024: 0x0000
kfdhdb.dskname: DATA_0000 ; 0x028: length=9
kfdhdb.fgname: DATA_0000 ; 0x068: length=9
kfdhdb.crestmp.hi: 32937833 ; 0x0a8: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo: 1704514560; 0x0ac: USEC=0x0 MSEC=0x235 SECS=0x19 MINS=0x19
kfdhdb.dsksize: 51200 ; 0x0c4: 0x0000c800

这个最好用ultraedit编辑,生成hdisk5.txt。
kfed merge进去头文件信息到hdisk5:
[oracle@p520:/oracle]$kfed merge /dev/rhdisk3 text=/oracle/hdisk5.txt

验证是否修复成功
SQL> alter diskgroup data mount;
Diskgroup altered.

并且能够读出磁盘头信息:
[oracle@p520:/oracle]$kfed read /dev/rhdisk5
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
kfbh.check: 170969582 ; 0x00c: 0x0a30c9ee
kfbh.fcn.base: 0 ; 0x010: 0x00000242
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8
kfdhdb.driver.reserved[0]: 0 ; 0x008: 0x00000000
kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000
kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
kfdhdb.dsknum: 0 ; 0x024: 0x0000
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname: DATA_0000 ; 0x028: length=9
kfdhdb.grpname: DATA ; 0x048: length=4
kfdhdb.fgname: DATA_0000 ; 0x068: length=9
kfdhdb.capname: ; 0x088: length=0
kfdhdb.crestmp.hi: 32937833 ; 0x0a8: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo: 1704514560 ; 0x0ac: USEC=0x0 MSEC=0x235 SECS=0x19 MINS=0x19
kfdhdb.mntstmp.hi: 32937834 ; 0x0b0: HOUR=0xa DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.mntstmp.lo: 679906304 ; 0x0b4: USEC=0x0 MSEC=0x1a3 SECS=0x8 MINS=0xa
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: 51200 ; 0x0c4: 0x0000c800
kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001
kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002
kfdhdb.redomirrors[0]: 0 ; 0x0d8: 0x0000
kfdhdb.redomirrors[1]: 65535 ; 0x0da: 0xffff
kfdhdb.redomirrors[2]: 65535 ; 0x0dc: 0xffff
kfdhdb.redomirrors[3]: 65535 ; 0x0de: 0xffff
kfdhdb.dbcompat: 168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi: 32937833 ; 0x0e4: HOUR=0x9 DAYS=0x1b MNTH=0x5 YEAR=0x7da
kfdhdb.grpstmp.lo: 1704339456 ; 0x0e8: USEC=0x0 MSEC=0x18a SECS=0x19 MINS=0x19
修复成功。

6、磁盘组所有磁盘头信息丢失的恢复:
1)破坏磁盘组磁盘头信息:
SQL> select DISK_NUMBER,name,path from v$asm_disk where group_number=2;
DISK_NUMBER NAME PATH
----------- -------------------- --------------------
1 DGTEST_0001 /dev/rhdisk7
0 DGTEST_0000 /dev/rhdisk5
[oracle@p520:/oracle/app/oracle]$dd if=/dev/zero f=/dev/rhdisk5 bs=4096 count=1
1+0 records in.
1+0 records out.
[oracle@p520:/oracle/app/oracle]$dd if=/dev/zero f=/dev/rhdisk6 bs=4096 count=1
1+0 records in.
1+0 records out.
SQL> alter diskgroup dgtest mount;
alter diskgroup dgtest mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DGTEST"

2)通过查找file directory盘来查找磁盘信息;
我们确定hdisk5为file directory盘;并用以下命令找到disk directory盘:
可以用select name,path from v$asm_disk查出。

3)根据上面的信息查找磁盘组磁盘信息:
kfed read /dev/rhdisk5 aunum=3 blknum=0|more
得到磁盘hdisk5磁盘头信息:
kfddde[0].entry.incarn: 1 ; 0x024: A=1 NUMM=0x0
kfddde[0].entry.hash: 0 ; 0x028: 0x00000000
kfddde[0].entry.refer.number:4294967295 ; 0x02c: 0xffffffff
kfddde[0].entry.refer.incarn: 0 ; 0x030: A=0 NUMM=0x0
kfddde[0].dsknum: 0 ; 0x034: 0x0000
kfddde[0].state: 2 ; 0x036: KFDSTA_NORMAL
kfddde[0].ub1spare: 0 ; 0x037: 0x00
kfddde[0].dskname: DGTEST_0000 ; 0x038: length=11
kfddde[0].fgname: DGTEST_0000 ; 0x058: length=11
kfddde[0].crestmp.hi: 32937866 ; 0x078: HOUR=0xa DAYS=0x1c MNTH=0x5 YEAR=0x7da
kfddde[0].crestmp.lo: 3925069824 ; 0x07c: USEC=0x0 MSEC=0xf4 SECS=0x1f MINS=0x3a
kfddde[0].failstmp.hi: 0 ; 0x080: HOUR=0x0 DAYS=0x0 MNTH=0x0 YEAR=0x0
kfddde[0].failstmp.lo: 0 ; 0x084: USEC=0x0 MSEC=0x0 SECS=0x0 MINS=0x0
kfddde[0].timer: 0 ; 0x088: 0x00000000
kfddde[0].size: 51200 ; 0x08c: 0x0000c800
kfddde[0].spare[0]: 0 ; 0x090: 0x00000000
kfddde[0].spare[1]: 0 ; 0x094: 0x00000000
kfddde[0].spare[2]: 0 ; 0x098: 0x00000000
kfddde[0].spare[3]: 0 ; 0x09c: 0x00000000
kfddde[0].spare[4]: 0 ; 0x0a0: 0x00000000
kfddde[0].zones[0].start: 0 ; 0x0a4: 0x00000000
kfddde[0].zones[0].size: 51200 ; 0x0a8: 0x0000c800
kfddde[0].zones[0].used: 90 ; 0x0ac: 0x0000005a
kfddde[0].zones[0].spare: 0 ; 0x0b0: 0x00000000

得到磁盘hdisk7磁盘头信息:
kfddde[1].entry.incarn: 1 ; 0x1e4: A=1 NUMM=0x0
kfddde[1].entry.hash: 1 ; 0x1e8: 0x00000001
kfddde[1].entry.refer.number:4294967295 ; 0x1ec: 0xffffffff
kfddde[1].entry.refer.incarn: 0 ; 0x1f0: A=0 NUMM=0x0
kfddde[1].dsknum: 1 ; 0x1f4: 0x0001
kfddde[1].state: 2 ; 0x1f6: KFDSTA_NORMAL
kfddde[1].ub1spare: 0 ; 0x1f7: 0x00
kfddde[1].dskname: DGTEST_0001 ; 0x1f8: length=11
kfddde[1].fgname: DGTEST_0001 ; 0x218: length=11
kfddde[1].crestmp.hi: 32937866 ; 0x238: HOUR=0xa DAYS=0x1c MNTH=0x5 YEAR=0x7da
kfddde[1].crestmp.lo: 3925069824 ; 0x23c: USEC=0x0 MSEC=0xf4 SECS=0x1f MINS=0x3a
kfddde[1].failstmp.hi: 0 ; 0x240: HOUR=0x0 DAYS=0x0 MNTH=0x0 YEAR=0x0
kfddde[1].failstmp.lo: 0 ; 0x244: USEC=0x0 MSEC=0x0 SECS=0x0 MINS=0x0
kfddde[1].timer: 0 ; 0x248: 0x00000000
kfddde[1].size: 2048 ; 0x24c: 0x00000800
kfddde[1].spare[0]: 0 ; 0x250: 0x00000000
kfddde[1].spare[1]: 0 ; 0x254: 0x00000000
kfddde[1].spare[2]: 0 ; 0x258: 0x00000000
kfddde[1].spare[3]: 0 ; 0x25c: 0x00000000
kfddde[1].spare[4]: 0 ; 0x260: 0x00000000
kfddde[1].zones[0].start: 0 ; 0x264: 0x00000000
kfddde[1].zones[0].size: 2048 ; 0x268: 0x00000800
kfddde[1].zones[0].used: 5 ; 0x26c: 0x00000005
kfddde[1].zones[0].spare: 0 ; 0x270: 0x00000000

4)根据上面信息,我们重新生成hdisk5和hdisk7的磁盘头文件信息:
hdisk5磁盘头文件信息:
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
kfbh.block.obj: {2147483648} ; 0x008: TYPE=0x8 NUMB=0x0
kfbh.check: 0 ; 0x00c: 0x750bcb49
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8
kfdhdb.driver.reserved[0]: 0 ; 0x008: 0x00000000
kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000
kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
kfdhdb.dsknum: {0} ; 0x024: 0x0000
kfdhdb.grptyp: {1} ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts: {3} ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname: {DGTEST_0000} ; 0x028: length=11
kfdhdb.grpname: {DGTEST} ; 0x048: length=6
kfdhdb.fgname: {DGTEST_0000} ; 0x068: length=11
kfdhdb.capname: ; 0x088: length=0
kfdhdb.crestmp.hi: {32937866} ; 0x0a8: HOUR=0xa DAYS=0x1c MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo: {3925069824} ; 0x0ac: USEC=0x0 MSEC=0xf4 SECS=0x1f MINS=0x3a
kfdhdb.mntstmp.hi: 32937866 ; 0x0b0: HOUR=0xa DAYS=0x1c MNTH=0x5 YEAR=0x7da
kfdhdb.mntstmp.lo: 3933855744 ; 0x0b4: USEC=0x0 MSEC=0x278 SECS=0x27 MINS=0x3a
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: {51200} ; 0x0c4: 0x0000c800
kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001
kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002
kfdhdb.redomirrors[0]: 0 ; 0x0d8: 0x0000
kfdhdb.redomirrors[1]: 0 ; 0x0da: 0x0000
kfdhdb.redomirrors[2]: 0 ; 0x0dc: 0x0000
kfdhdb.redomirrors[3]: 0 ; 0x0de: 0x0000
kfdhdb.dbcompat: 168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi: 32937866 ; 0x0e4: HOUR=0xa DAYS=0x1c MNTH=0x5 YEAR=0x7da
kfdhdb.grpstmp.lo: 3924577280 ; 0x0e8: USEC=0x0 MSEC=0x313 SECS=0x1e MINS=0x3a
kfdhdb.ub4spare[0]: 0 ; 0x0ec: 0x00000000
kfdhdb.ub4spare[1]: 0 ; 0x0f0: 0x00000000
kfdhdb.ub4spare[2]: 0 ; 0x0f4: 0x00000000
kfdhdb.ub4spare[3]: 0 ; 0x0f8: 0x00000000
kfdhdb.ub4spare[4]: 0 ; 0x0fc: 0x00000000
kfdhdb.ub4spare[5]: 0 ; 0x100: 0x00000000
kfdhdb.ub4spare[6]: 0 ; 0x104: 0x00000000
kfdhdb.ub4spare[7]: 0 ; 0x108: 0x00000000
kfdhdb.ub4spare[8]: 0 ; 0x10c: 0x00000000
kfdhdb.ub4spare[9]: 0 ; 0x110: 0x00000000
kfdhdb.ub4spare[10]: 0 ; 0x114: 0x00000000
kfdhdb.ub4spare[11]: 0 ; 0x118: 0x00000000
kfdhdb.ub4spare[12]: 0 ; 0x11c: 0x00000000
kfdhdb.ub4spare[13]: 0 ; 0x120: 0x00000000
kfdhdb.ub4spare[14]: 0 ; 0x124: 0x00000000
kfdhdb.ub4spare[15]: 0 ; 0x128: 0x00000000
kfdhdb.ub4spare[16]: 0 ; 0x12c: 0x00000000
kfdhdb.ub4spare[17]: 0 ; 0x130: 0x00000000
kfdhdb.ub4spare[18]: 0 ; 0x134: 0x00000000
kfdhdb.ub4spare[19]: 0 ; 0x138: 0x00000000
kfdhdb.ub4spare[20]: 0 ; 0x13c: 0x00000000
kfdhdb.ub4spare[21]: 0 ; 0x140: 0x00000000
kfdhdb.ub4spare[22]: 0 ; 0x144: 0x00000000
kfdhdb.ub4spare[23]: 0 ; 0x148: 0x00000000
kfdhdb.ub4spare[24]: 0 ; 0x14c: 0x00000000
kfdhdb.ub4spare[25]: 0 ; 0x150: 0x00000000
kfdhdb.ub4spare[26]: 0 ; 0x154: 0x00000000
kfdhdb.ub4spare[27]: 0 ; 0x158: 0x00000000
kfdhdb.ub4spare[28]: 0 ; 0x15c: 0x00000000
kfdhdb.ub4spare[29]: 0 ; 0x160: 0x00000000
kfdhdb.ub4spare[30]: 0 ; 0x164: 0x00000000
kfdhdb.ub4spare[31]: 0 ; 0x168: 0x00000000
kfdhdb.ub4spare[32]: 0 ; 0x16c: 0x00000000
kfdhdb.ub4spare[33]: 0 ; 0x170: 0x00000000
kfdhdb.ub4spare[34]: 0 ; 0x174: 0x00000000
kfdhdb.ub4spare[35]: 0 ; 0x178: 0x00000000
kfdhdb.ub4spare[36]: 0 ; 0x17c: 0x00000000
kfdhdb.ub4spare[37]: 0 ; 0x180: 0x00000000
kfdhdb.ub4spare[38]: 0 ; 0x184: 0x00000000
kfdhdb.ub4spare[39]: 0 ; 0x188: 0x00000000
kfdhdb.ub4spare[40]: 0 ; 0x18c: 0x00000000
kfdhdb.ub4spare[41]: 0 ; 0x190: 0x00000000
kfdhdb.ub4spare[42]: 0 ; 0x194: 0x00000000
kfdhdb.ub4spare[43]: 0 ; 0x198: 0x00000000
kfdhdb.ub4spare[44]: 0 ; 0x19c: 0x00000000
kfdhdb.ub4spare[45]: 0 ; 0x1a0: 0x00000000
kfdhdb.ub4spare[46]: 0 ; 0x1a4: 0x00000000
kfdhdb.ub4spare[47]: 0 ; 0x1a8: 0x00000000
kfdhdb.ub4spare[48]: 0 ; 0x1ac: 0x00000000
kfdhdb.ub4spare[49]: 0 ; 0x1b0: 0x00000000
kfdhdb.ub4spare[50]: 0 ; 0x1b4: 0x00000000
kfdhdb.ub4spare[51]: 0 ; 0x1b8: 0x00000000
kfdhdb.ub4spare[52]: 0 ; 0x1bc: 0x00000000
kfdhdb.ub4spare[53]: 0 ; 0x1c0: 0x00000000
kfdhdb.ub4spare[54]: 0 ; 0x1c4: 0x00000000
kfdhdb.ub4spare[55]: 0 ; 0x1c8: 0x00000000
kfdhdb.ub4spare[56]: 0 ; 0x1cc: 0x00000000
kfdhdb.ub4spare[57]: 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

hdisk7磁盘头文件信息
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
kfbh.block.obj: {2147483649} ; 0x008: TYPE=0x8 NUMB=0x1
kfbh.check: 1963592522 ; 0x00c: 0x750a0b4a
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8
kfdhdb.driver.reserved[0]: 0 ; 0x008: 0x00000000
kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000
kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
kfdhdb.dsknum: {1} ; 0x024: 0x0001
kfdhdb.grptyp: {1} ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts: {3} ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname: {DGTEST_0001} ; 0x028: length=11
kfdhdb.grpname: {DGTEST} ; 0x048: length=6
kfdhdb.fgname: {DGTEST_0001} ; 0x068: length=11
kfdhdb.capname: ; 0x088: length=0
kfdhdb.crestmp.hi: {32937866} ; 0x0a8: HOUR=0xa DAYS=0x1c MNTH=0x5 YEAR=0x7da
kfdhdb.crestmp.lo: {3925069824} ; 0x0ac: USEC=0x0 MSEC=0xf4 SECS=0x1f MINS=0x3a
kfdhdb.mntstmp.hi: 32937866 ; 0x0b0: HOUR=0xa DAYS=0x1c MNTH=0x5 YEAR=0x7da
kfdhdb.mntstmp.lo: 3933855744 ; 0x0b4: USEC=0x0 MSEC=0x278 SECS=0x27 MINS=0x3a
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: {2048} ; 0x0c4: 0x00000800
kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001
kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn: 0 ; 0x0d4: 0x00000000
kfdhdb.redomirrors[0]: 0 ; 0x0d8: 0x0000
kfdhdb.redomirrors[1]: 0 ; 0x0da: 0x0000
kfdhdb.redomirrors[2]: 0 ; 0x0dc: 0x0000
kfdhdb.redomirrors[3]: 0 ; 0x0de: 0x0000
kfdhdb.dbcompat: 168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi: 32937866 ; 0x0e4: HOUR=0xa DAYS=0x1c MNTH=0x5 YEAR=0x7da
kfdhdb.grpstmp.lo: 3924577280 ; 0x0e8: USEC=0x0 MSEC=0x313 SECS=0x1e MINS=0x3a
kfdhdb.ub4spare[0]: 0 ; 0x0ec: 0x00000000
kfdhdb.ub4spare[1]: 0 ; 0x0f0: 0x00000000
kfdhdb.ub4spare[2]: 0 ; 0x0f4: 0x00000000
kfdhdb.ub4spare[3]: 0 ; 0x0f8: 0x00000000
kfdhdb.ub4spare[4]: 0 ; 0x0fc: 0x00000000
kfdhdb.ub4spare[5]: 0 ; 0x100: 0x00000000
kfdhdb.ub4spare[6]: 0 ; 0x104: 0x00000000
kfdhdb.ub4spare[7]: 0 ; 0x108: 0x00000000
kfdhdb.ub4spare[8]: 0 ; 0x10c: 0x00000000
kfdhdb.ub4spare[9]: 0 ; 0x110: 0x00000000
kfdhdb.ub4spare[10]: 0 ; 0x114: 0x00000000
kfdhdb.ub4spare[11]: 0 ; 0x118: 0x00000000
kfdhdb.ub4spare[12]: 0 ; 0x11c: 0x00000000
kfdhdb.ub4spare[13]: 0 ; 0x120: 0x00000000
kfdhdb.ub4spare[14]: 0 ; 0x124: 0x00000000
kfdhdb.ub4spare[15]: 0 ; 0x128: 0x00000000
kfdhdb.ub4spare[16]: 0 ; 0x12c: 0x00000000
kfdhdb.ub4spare[17]: 0 ; 0x130: 0x00000000
kfdhdb.ub4spare[18]: 0 ; 0x134: 0x00000000
kfdhdb.ub4spare[19]: 0 ; 0x138: 0x00000000
kfdhdb.ub4spare[20]: 0 ; 0x13c: 0x00000000
kfdhdb.ub4spare[21]: 0 ; 0x140: 0x00000000
kfdhdb.ub4spare[22]: 0 ; 0x144: 0x00000000
kfdhdb.ub4spare[23]: 0 ; 0x148: 0x00000000
kfdhdb.ub4spare[24]: 0 ; 0x14c: 0x00000000
kfdhdb.ub4spare[25]: 0 ; 0x150: 0x00000000
kfdhdb.ub4spare[26]: 0 ; 0x154: 0x00000000
kfdhdb.ub4spare[27]: 0 ; 0x158: 0x00000000
kfdhdb.ub4spare[28]: 0 ; 0x15c: 0x00000000
kfdhdb.ub4spare[29]: 0 ; 0x160: 0x00000000
kfdhdb.ub4spare[30]: 0 ; 0x164: 0x00000000
kfdhdb.ub4spare[31]: 0 ; 0x168: 0x00000000
kfdhdb.ub4spare[32]: 0 ; 0x16c: 0x00000000
kfdhdb.ub4spare[33]: 0 ; 0x170: 0x00000000
kfdhdb.ub4spare[34]: 0 ; 0x174: 0x00000000
kfdhdb.ub4spare[35]: 0 ; 0x178: 0x00000000
kfdhdb.ub4spare[36]: 0 ; 0x17c: 0x00000000
kfdhdb.ub4spare[37]: 0 ; 0x180: 0x00000000
kfdhdb.ub4spare[38]: 0 ; 0x184: 0x00000000
kfdhdb.ub4spare[39]: 0 ; 0x188: 0x00000000
kfdhdb.ub4spare[40]: 0 ; 0x18c: 0x00000000
kfdhdb.ub4spare[41]: 0 ; 0x190: 0x00000000
kfdhdb.ub4spare[42]: 0 ; 0x194: 0x00000000
kfdhdb.ub4spare[43]: 0 ; 0x198: 0x00000000
kfdhdb.ub4spare[44]: 0 ; 0x19c: 0x00000000
kfdhdb.ub4spare[45]: 0 ; 0x1a0: 0x00000000
kfdhdb.ub4spare[46]: 0 ; 0x1a4: 0x00000000
kfdhdb.ub4spare[47]: 0 ; 0x1a8: 0x00000000
kfdhdb.ub4spare[48]: 0 ; 0x1ac: 0x00000000
kfdhdb.ub4spare[49]: 0 ; 0x1b0: 0x00000000
kfdhdb.ub4spare[50]: 0 ; 0x1b4: 0x00000000
kfdhdb.ub4spare[51]: 0 ; 0x1b8: 0x00000000
kfdhdb.ub4spare[52]: 0 ; 0x1bc: 0x00000000
kfdhdb.ub4spare[53]: 0 ; 0x1c0: 0x00000000
kfdhdb.ub4spare[54]: 0 ; 0x1c4: 0x00000000
kfdhdb.ub4spare[55]: 0 ; 0x1c8: 0x00000000
kfdhdb.ub4spare[56]: 0 ; 0x1cc: 0x00000000
kfdhdb.ub4spare[57]: 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

5)恢复磁盘头:
kfed merge磁盘头信息:
[oracle@p520:/oracle/app/oracle]$kfed merge /dev/rhdisk5 text=hdisk5.txt
[oracle@p520:/oracle/app/oracle]$kfed merge /dev/rhdisk7 text=hdisk7.txt
SQL> select name,state from v$asm_diskgroup;
name state
---------- ---------------
DGTEST DISMOUNTED
SQL> alter diskgroup dgtest mount;
Diskgroup altered.
修复成功.

四、实验总结

1、修复磁盘头信息思路:
找到file directory ,再根据file directory 找到 disk directory;
根据disk directory找出磁盘信息,手工编辑磁盘头文件,最后用kfed merge到对应磁盘中,生成磁盘头
信息。
2、file directory一般在磁盘组某个磁盘au=2 的位置上,如果对磁盘组做过删除盘和增加盘的操作,
file directory不一定在au=2的位置上,需要手工去查找。
3、对有客户使用asm,建议备份下磁盘头信息。
4、客户生产数据库还是要做好备份。
5、oracle 11g已经有操作磁盘头信息的工具amdu,10g环境如果要使用,需要单独下载,参考METALINK文档
Placeholder for AMDU binaries and using with ASM 10g [ID 553639.1]。
6、kfed工具使用建议oracle版本在10.2.0.2以上,oracle 10.2.0.1会有bug。

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】