您好,登錄后才能下訂單哦!
這篇文章主要講解了“怎么修復ASM磁盤頭信息損壞問題”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“怎么修復ASM磁盤頭信息損壞問題”吧!
KFED主要用來編輯和修復ASM metadata,可以在DiskGroup沒有mount的情況下使用;因此在ASM無法啟動、DiskGroup無法mount的時候可以嘗試使用這個神器來修復。
kfed工具支持對于ASM信息的READ/WRITE/MERGE/NEW/ FORM/FIND/STRUCT等操作,11gR2之前需要手工編譯.
一、編譯kfed工具
1.編譯
[oracle@node1 ~]$ cd $ORACLE_HOME/rdbms/lib
[oracle@node1 lib]$ make -f ins_rdbms.mk ikfed
2.配置環(huán)境變量
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/rdbms/lib:$PATH
3.查看幫助
[oracle@node1 ~]$ kfed -help
as/mlibASM Library [asmlib='lib']
aun/umAU number to examine or update [AUNUM=number]
aus/zAllocation Unit size in bytes [AUSZ=number]
blkn/umBlock number to examine or update [BLKNUM=number]
blks/zMetadata block size in bytes [BLKSZ=number]
ch/ksumUpdate checksum before each write [CHKSUM=YES/NO]
cn/tCount of AUs to process [CNT=number]
de/vASM device to examine or update [DEV=string]
dm/pallDon't suppress repeated lines when dumping corrupt blocks [DMPALL=YES/NO]
o/p KFED operation type [OP=READ/WRITE/MERGE/REPAIR/NEW/FORM/FIND/STRUCT]
p/rovnmName for provisioning purposes [PROVNM=string]
s/eekAU number to seek to [SEEK=number]
te/xtFile name for translated block text [TEXT=string]
ty/peASM metadata block type number [TYPE=number]
asm的每個磁盤上有存放有asm的元數據,元數據一般大小為4k。disk header一般在第0個au,第0個塊上。
二、模擬損壞磁盤頭信息
1. 備份磁盤頭信息:
[root@axj-rac1 backup]#dd if=/dev/raw/raw5 of=/backup/raw5.bak bs=1M count=2
[root@axj-rac1 backup]#dd if=/dev/raw/raw6 of=/backup/raw6.bak bs=1M count=2
[root@axj-rac1 backup]#dd if=/dev/raw/raw7 of=/backup/raw7.bak bs=1M count=2
備份成txt格式
kfed read /dev/raw/raw6 text=/home/oracle/asmdisk_raw6.txt
2. 查看備份的磁盤頭信息
[root@axj-rac1 oracle]# cat asmdisk_raw6.txt
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
kfbh.block.obj: 2147483649 ; 0x008: disk=1
kfbh.check: 3657275721 ; 0x00c: 0xd9fd9949
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: 186646528 ; 0x020: 0x0b200000
kfdhdb.dsknum: 1 ; 0x024: 0x0001
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL --磁盤組冗余方式
kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER --磁盤組狀態(tài),3是可用狀態(tài)
kfdhdb.dskname: DATADG01_0001 ; 0x028: length=13
kfdhdb.grpname: DATADG01 ; 0x048: length=8 --磁盤組名字
kfdhdb.fgname: DATADG01_0001 ; 0x068: length=13
kfdhdb.capname: ; 0x088: length=0
kfdhdb.crestmp.hi: 33026093 ; 0x0a8: HOUR=0xd DAYS=0x1 MNTH=0xc YEAR=0x7df
kfdhdb.crestmp.lo: 2356159488 ; 0x0ac: USEC=0x0 MSEC=0x9 SECS=0x7 MINS=0x23
kfdhdb.mntstmp.hi: 33032273 ; 0x0b0: HOUR=0x11 DAYS=0x2 MNTH=0x2 YEAR=0x7e0
kfdhdb.mntstmp.lo: 3209038848 ; 0x0b4: USEC=0x0 MSEC=0x183 SECS=0x34 MINS=0x2f
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000 --au的大小,單位是byte,大小是1M
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: 4008 ; 0x0c4: 0x00000fa8 --該disk的大小,單位是au,默認au是1m,所以大小為4008M
kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001
kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn: 0 ; 0x0d4: 0x00000000 --file directory所在的au位置
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: 33024790 ; 0x0e4: HOUR=0x16 DAYS=0x18 MNTH=0xa YEAR=0x7df
kfdhdb.grpstmp.lo: 258378752 ; 0x0e8: USEC=0x0 MSEC=0x1a3 SECS=0x36 MINS=0x3
kfdhdb.vfstart: 0 ; 0x0ec: 0x00000000
kfdhdb.vfend: 0 ; 0x0f0: 0x00000000
kfdhdb.spfile: 0 ; 0x0f4: 0x00000000
kfdhdb.spfflg: 0 ; 0x0f8: 0x00000000
kfdhdb.ub4spare[0]: 0 ; 0x0fc: 0x00000000
kfdhdb.ub4spare[1]: 0 ; 0x100: 0x00000000
kfdhdb.ub4spare[2]: 0 ; 0x104: 0x00000000
kfdhdb.ub4spare[3]: 0 ; 0x108: 0x00000000
kfdhdb.ub4spare[4]: 0 ; 0x10c: 0x00000000
kfdhdb.ub4spare[5]: 0 ; 0x110: 0x00000000
kfdhdb.ub4spare[6]: 0 ; 0x114: 0x00000000
kfdhdb.ub4spare[7]: 0 ; 0x118: 0x00000000
kfdhdb.ub4spare[8]: 0 ; 0x11c: 0x00000000
kfdhdb.ub4spare[9]: 0 ; 0x120: 0x00000000
kfdhdb.ub4spare[10]: 0 ; 0x124: 0x00000000
kfdhdb.ub4spare[11]: 0 ; 0x128: 0x00000000
kfdhdb.ub4spare[12]: 0 ; 0x12c: 0x00000000
kfdhdb.ub4spare[13]: 0 ; 0x130: 0x00000000
kfdhdb.ub4spare[14]: 0 ; 0x134: 0x00000000
kfdhdb.ub4spare[15]: 0 ; 0x138: 0x00000000
kfdhdb.ub4spare[16]: 0 ; 0x13c: 0x00000000
kfdhdb.ub4spare[17]: 0 ; 0x140: 0x00000000
kfdhdb.ub4spare[18]: 0 ; 0x144: 0x00000000
kfdhdb.ub4spare[19]: 0 ; 0x148: 0x00000000
kfdhdb.ub4spare[20]: 0 ; 0x14c: 0x00000000
kfdhdb.ub4spare[21]: 0 ; 0x150: 0x00000000
kfdhdb.ub4spare[22]: 0 ; 0x154: 0x00000000
kfdhdb.ub4spare[23]: 0 ; 0x158: 0x00000000
kfdhdb.ub4spare[24]: 0 ; 0x15c: 0x00000000
kfdhdb.ub4spare[25]: 0 ; 0x160: 0x00000000
kfdhdb.ub4spare[26]: 0 ; 0x164: 0x00000000
kfdhdb.ub4spare[27]: 0 ; 0x168: 0x00000000
kfdhdb.ub4spare[28]: 0 ; 0x16c: 0x00000000
kfdhdb.ub4spare[29]: 0 ; 0x170: 0x00000000
kfdhdb.ub4spare[30]: 0 ; 0x174: 0x00000000
kfdhdb.ub4spare[31]: 0 ; 0x178: 0x00000000
kfdhdb.ub4spare[32]: 0 ; 0x17c: 0x00000000
kfdhdb.ub4spare[33]: 0 ; 0x180: 0x00000000
kfdhdb.ub4spare[34]: 0 ; 0x184: 0x00000000
kfdhdb.ub4spare[35]: 0 ; 0x188: 0x00000000
kfdhdb.ub4spare[36]: 0 ; 0x18c: 0x00000000
kfdhdb.ub4spare[37]: 0 ; 0x190: 0x00000000
kfdhdb.ub4spare[38]: 0 ; 0x194: 0x00000000
kfdhdb.ub4spare[39]: 0 ; 0x198: 0x00000000
kfdhdb.ub4spare[40]: 0 ; 0x19c: 0x00000000
kfdhdb.ub4spare[41]: 0 ; 0x1a0: 0x00000000
kfdhdb.ub4spare[42]: 0 ; 0x1a4: 0x00000000
kfdhdb.ub4spare[43]: 0 ; 0x1a8: 0x00000000
kfdhdb.ub4spare[44]: 0 ; 0x1ac: 0x00000000
kfdhdb.ub4spare[45]: 0 ; 0x1b0: 0x00000000
kfdhdb.ub4spare[46]: 0 ; 0x1b4: 0x00000000
kfdhdb.ub4spare[47]: 0 ; 0x1b8: 0x00000000
kfdhdb.ub4spare[48]: 0 ; 0x1bc: 0x00000000
kfdhdb.ub4spare[49]: 0 ; 0x1c0: 0x00000000
kfdhdb.ub4spare[50]: 0 ; 0x1c4: 0x00000000
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
3.破壞磁盤頭的元數據,這里我開始破壞了raw5,后來為達到效果又破壞了下面兩個
[root@axj-rac1 backup]# dd if=/dev/zero of=/dev/raw/raw5 bs=4096 count=1
[root@axj-rac1 backup]# dd if=/dev/zero of=/dev/raw/raw6 bs=4096 count=1
[root@axj-rac1 backup]# dd if=/dev/zero of=/dev/raw/raw7 bs=4096 count=1
4.查看一下磁盤頭的狀態(tài)
col group_number format a30
col disk_number format a30
col name format a30
col header_status format a30
col path format a30
col group_number clear
col disk_number clear
set linesize 200 pagesize 2000
SQL> select group_number,disk_number,name,header_status,path from v$asm_disk;
GROUP_NUMBER DISK_NUMBER NAMEHEADER_STATU PATH
---------------------- ---------------------------
2 0 OCR_VOTE_0000MEMBER /dev/raw/raw1
1 1 DATADG01_0001MEMBER /dev/raw/raw6
2 1 OCR_VOTE_0001MEMBER /dev/raw/raw2
2 2 OCR_VOTE_0002MEMBER /dev/raw/raw3
1 0 DATADG01_0000MEMBER /dev/raw/raw5
1 2 DATADG01_0002MEMBER /dev/raw/raw7
上面是正常的狀態(tài)
SQL> select group_number,disk_number,name,header_status,path from v$asm_disk;
GROUP_NUMBER DISK_NUMBER NAMEHEADER_STATUS PATH
------------ ---------------------------------------
2 0 OCR_VOTE_0000MEMBER /dev/raw/raw1
1 1 DATADG01_0001MEMBER /dev/raw/raw6
2 1 OCR_VOTE_0001MEMBER /dev/raw/raw2
2 2 OCR_VOTE_0002MEMBER /dev/raw/raw3
1 0 DATADG01_0000CANDIDATE /dev/raw/raw5
1 2 DATADG01_0002MEMBER /dev/raw/raw7
這里是破壞后的狀態(tài),raw狀態(tài)為CANDIDATE
5.破壞后查看用kfed查看raw5的磁盤頭的信息
[root@axj-rac1 oracle]# kfed read /dev/raw/raw5 aun=0 blkn=0
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
7F5595918400 00000000 00000000 00000000 00000000 [................]
Repeat 255 times
KFED-00322: Invalid content encountered during block traversal: [kfbtTraverseBlock][Invalid OSM block type][][0]
可以看到已經報錯了,跟上面的不一樣了。
依次查看raw6和raw7的磁盤頭信息
kfed read /backup/raw6.bak aun=1 blkn=254
kfed read /backup/raw7.bak aun=1 blkn=254
[root@axj-rac1 backup]# kfed read /backup/raw5.bak aun=1 blkn=254|grep kfbh.type
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
從10.2.0.5開始之后的版本header信息是有額外保護和備份的,那么備份在哪個位置
也是在disk的特定位置,這對au=1MB的dg,備份信息是在第510blkn的位置,我們可以看下位置510的信息:
[root@axj-rac1 backup]# kfed read /dev/raw/raw5 aun=0 blkn=510 | grep kfbh.type
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
可以看到510確實也是HEAD信息把它讀出來看看
[root@axj-rac1 backup]# kfed read /dev/raw/raw5 blkn=510
kfbh.endian: 1 ; 0x000: 0x01
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 254 ; 0x004: blk=254
kfbh.block.obj: 2147483648 ; 0x008: disk=0
kfbh.check: 323429756 ; 0x00c: 0x1347257c
kfbh.fcn.base: 16403 ; 0x010: 0x00004013
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: 186646528 ; 0x020: 0x0b200000
kfdhdb.dsknum: 0 ; 0x024: 0x0000
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname: DATADG01_0000 ; 0x028: length=13
kfdhdb.grpname: DATADG01 ; 0x048: length=8
kfdhdb.fgname: DATADG01_0000 ; 0x068: length=13
kfdhdb.capname: ; 0x088: length=0
kfdhdb.crestmp.hi: 33024790 ; 0x0a8: HOUR=0x16 DAYS=0x18 MNTH=0xa YEAR=0x7df
kfdhdb.crestmp.lo: 258502656 ; 0x0ac: USEC=0x0 MSEC=0x21c SECS=0x36 MINS=0x3
kfdhdb.mntstmp.hi: 33032273 ; 0x0b0: HOUR=0x11 DAYS=0x2 MNTH=0x2 YEAR=0x7e0
kfdhdb.mntstmp.lo: 3209038848 ; 0x0b4: USEC=0x0 MSEC=0x183 SECS=0x34 MINS=0x2f
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: 2008 ; 0x0c4: 0x000007d8
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: 33024790 ; 0x0e4: HOUR=0x16 DAYS=0x18 MNTH=0xa YEAR=0x7df
kfdhdb.grpstmp.lo: 258378752 ; 0x0e8: USEC=0x0 MSEC=0x1a3 SECS=0x36 MINS=0x3
kfdhdb.vfstart: 0 ; 0x0ec: 0x00000000
kfdhdb.vfend: 0 ; 0x0f0: 0x00000000
kfdhdb.spfile: 0 ; 0x0f4: 0x00000000
kfdhdb.spfflg: 0 ; 0x0f8: 0x00000000
kfdhdb.ub4spare[0]: 0 ; 0x0fc: 0x00000000
kfdhdb.ub4spare[1]: 0 ; 0x100: 0x00000000
kfdhdb.ub4spare[2]: 0 ; 0x104: 0x00000000
kfdhdb.ub4spare[3]: 0 ; 0x108: 0x00000000
kfdhdb.ub4spare[4]: 0 ; 0x10c: 0x00000000
kfdhdb.ub4spare[5]: 0 ; 0x110: 0x00000000
kfdhdb.ub4spare[6]: 0 ; 0x114: 0x00000000
kfdhdb.ub4spare[7]: 0 ; 0x118: 0x00000000
kfdhdb.ub4spare[8]: 0 ; 0x11c: 0x00000000
kfdhdb.ub4spare[9]: 0 ; 0x120: 0x00000000
kfdhdb.ub4spare[10]: 0 ; 0x124: 0x00000000
kfdhdb.ub4spare[11]: 0 ; 0x128: 0x00000000
kfdhdb.ub4spare[12]: 0 ; 0x12c: 0x00000000
kfdhdb.ub4spare[13]: 0 ; 0x130: 0x00000000
kfdhdb.ub4spare[14]: 0 ; 0x134: 0x00000000
kfdhdb.ub4spare[15]: 0 ; 0x138: 0x00000000
kfdhdb.ub4spare[16]: 0 ; 0x13c: 0x00000000
kfdhdb.ub4spare[17]: 0 ; 0x140: 0x00000000
kfdhdb.ub4spare[18]: 0 ; 0x144: 0x00000000
kfdhdb.ub4spare[19]: 0 ; 0x148: 0x00000000
kfdhdb.ub4spare[20]: 0 ; 0x14c: 0x00000000
kfdhdb.ub4spare[21]: 0 ; 0x150: 0x00000000
kfdhdb.ub4spare[22]: 0 ; 0x154: 0x00000000
kfdhdb.ub4spare[23]: 0 ; 0x158: 0x00000000
kfdhdb.ub4spare[24]: 0 ; 0x15c: 0x00000000
kfdhdb.ub4spare[25]: 0 ; 0x160: 0x00000000
kfdhdb.ub4spare[26]: 0 ; 0x164: 0x00000000
kfdhdb.ub4spare[27]: 0 ; 0x168: 0x00000000
kfdhdb.ub4spare[28]: 0 ; 0x16c: 0x00000000
kfdhdb.ub4spare[29]: 0 ; 0x170: 0x00000000
kfdhdb.ub4spare[30]: 0 ; 0x174: 0x00000000
kfdhdb.ub4spare[31]: 0 ; 0x178: 0x00000000
kfdhdb.ub4spare[32]: 0 ; 0x17c: 0x00000000
kfdhdb.ub4spare[33]: 0 ; 0x180: 0x00000000
kfdhdb.ub4spare[34]: 0 ; 0x184: 0x00000000
kfdhdb.ub4spare[35]: 0 ; 0x188: 0x00000000
kfdhdb.ub4spare[36]: 0 ; 0x18c: 0x00000000
kfdhdb.ub4spare[37]: 0 ; 0x190: 0x00000000
kfdhdb.ub4spare[38]: 0 ; 0x194: 0x00000000
kfdhdb.ub4spare[39]: 0 ; 0x198: 0x00000000
kfdhdb.ub4spare[40]: 0 ; 0x19c: 0x00000000
kfdhdb.ub4spare[41]: 0 ; 0x1a0: 0x00000000
kfdhdb.ub4spare[42]: 0 ; 0x1a4: 0x00000000
kfdhdb.ub4spare[43]: 0 ; 0x1a8: 0x00000000
kfdhdb.ub4spare[44]: 0 ; 0x1ac: 0x00000000
kfdhdb.ub4spare[45]: 0 ; 0x1b0: 0x00000000
kfdhdb.ub4spare[46]: 0 ; 0x1b4: 0x00000000
kfdhdb.ub4spare[47]: 0 ; 0x1b8: 0x00000000
kfdhdb.ub4spare[48]: 0 ; 0x1bc: 0x00000000
kfdhdb.ub4spare[49]: 0 ; 0x1c0: 0x00000000
kfdhdb.ub4spare[50]: 0 ; 0x1c4: 0x00000000
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
通過對比我們可以發(fā)現(xiàn)與之前的raw5磁盤頭的內容是一摸一樣的。
6.由于之前破壞掉了raw5磁盤頭信息,看看有啥報錯
[oracle@axj-rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Mar 9 15:09:17 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup --重啟數據庫發(fā)現(xiàn)報錯了
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATADG01/rac11g/spfilerac11g.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATADG01/rac11g/spfilerac11g.ora
ORA-15077: could not locate ASM instance serving a required diskgroup
看看asm日志
SQL> ALTER DISKGROUP DATADG01 MOUNT /* asm agent *//* {2:10674:2} */
NOTE: cache registered group DATADG01 number=1 incarn=0xbec84ee5
NOTE: cache began mount (first) of group DATADG01 number=1 incarn=0xbec84ee5
Wed Mar 09 15:10:28 2016
ERROR: no read quorum in group: required 2, found 0 disks
NOTE: cache dismounting (clean) group 1/0xBEC84EE5 (DATADG01)
NOTE: messaging CKPT to quiesce pins Unix process pid: 3711, image: oracle@axj-rac1 (TNS V1-V3)
NOTE: dbwr not being msg'd to dismount
NOTE: lgwr not being msg'd to dismount
NOTE: cache dismounted group 1/0xBEC84EE5 (DATADG01)
NOTE: cache ending mount (fail) of group DATADG01 number=1 incarn=0xbec84ee5
NOTE: cache deleting context for group DATADG01 1/0xbec84ee5
GMON dismounting group 1 at 7 for pid 29, osid 3711
ERROR: diskgroup DATADG01 was not mounted
ORA-15032: not all alterations performed
ORA-15017: diskgroup "DATADG01" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATADG01"
可以看到的是datadg01無法mount
通過asmcmd查看,datadg01磁盤組都沒了
[grid@axj-rac1 trace]$ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 6024 5623 0 5623 0 Y OCR_VOTE/
三、修復磁盤頭
方法一:kfed修復磁盤頭
[grid@s1-11g dev]$
kfed repair /dev/raw/raw5
kfed repair /dev/raw/raw6
kfed repair /dev/raw/raw7
方法二: dd修復,用之前的備份
[grid@s1-11g dev]$
dd if=/backup/raw5 of=/dev/raw/raw5
dd if=/backup/raw6 of=/dev/raw/raw6
dd if=/backup/raw7 of=/dev/raw/raw7
方法三: 利用oracle的kfed工具來備份,格式是文本格式,恢復時使用kfed merge進去
備份:
kfed read /dev/raw/raw5 aunum=0 blknum=0 text=/home/oracle/raw5.txt
kfed read /dev/raw/raw6 aunum=0 blknum=0 text=/home/oracle/raw6.txt
kfed read /dev/raw/raw7 aunum=0 blknum=0 text=/home/oracle/raw7.txt
恢復:
kfed write /dev/raw/raw5 aunum=0 blknum=0 text=raw5.txt
kfed write /dev/raw/raw6 aunum=0 blknum=0 text=raw6.txt
kfed write /dev/raw/raw7 aunum=0 blknum=0 text=raw7.txt
這里我用的是方法一修復的
1.恢復完成后查看磁盤頭信息:
[root@axj-rac1 oracle]# kfed read /dev/raw/raw5 aun=0 blkn=0|grep kfbh.type
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
2.然后成功mount磁盤組
3.查看dg狀態(tài)可以看到是mounted狀態(tài)
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 10024 6581 0 6581 0 N DATADG01/
MOUNTED EXTERN N 512 4096 1048576 6024 5623 0 5623 0 Y OCR_VOTE/
可以看到datadg02已結mount了
3.重新查詢磁盤組以及磁盤信息
col group_number format a30
col disk_number format a30
col name format a30
col header_status format a30
col path format a30
col group_number clear
col disk_number clear
set linesize 200 pagesize 2000
SQL>select group_number,disk_number,name,header_status,path from v$asm_disk;
GROUP_NUMBER DISK_NUMBER NAMEHEADER_STATUS PATH
------------ ----------- -----------------------------
1 1 DATADG01_0001MEMBER /dev/raw/raw6
1 0 DATADG01_0000MEMBER /dev/raw/raw5
2 1 OCR_VOTE_0001MEMBER /dev/raw/raw2
2 0 OCR_VOTE_0000MEMBER /dev/raw/raw1
1 2 DATADG01_0002MEMBER /dev/raw/raw7
2 2 OCR_VOTE_0002MEMBER /dev/raw/raw3
可以看到所有狀態(tài)已經正常,數據庫也正常啟動。
感謝各位的閱讀,以上就是“怎么修復ASM磁盤頭信息損壞問題”的內容了,經過本文的學習后,相信大家對怎么修復ASM磁盤頭信息損壞問題這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。