中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Oracle 10g rac+asm 磁盤頭備份與恢復實驗

發布時間:2020-08-08 23:33:42 來源:ITPUB博客 閱讀:176 作者:event_horizon 欄目:建站服務器

作者:
paulyibinyi

一、實驗目的:

我們經常由于誤操作,比如對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。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

东辽县| 准格尔旗| 沙坪坝区| 百色市| 凯里市| 新河县| 内丘县| 三台县| 招远市| 古浪县| 永丰县| 安西县| 嵊州市| 泰安市| 嘉峪关市| 石城县| 广汉市| 通化县| 永仁县| 汉沽区| 永吉县| 双城市| 石台县| 贵溪市| 安达市| 紫云| 宜君县| 安多县| 陕西省| 阳江市| 公安县| 龙井市| 舒城县| 霍州市| 广安市| 砀山县| 礼泉县| 辉南县| 大荔县| 包头市| 桐梓县|