【ASM】ASM磁碟頭被重寫,如何修復

xysoul_雲龍發表於2021-04-06


本文件提供一個關於ASM磁碟頭資料被修復的例子。


ASM磁碟頭(前4K)的副本存在於10.2.0.5、11.1.0.7、11.2及以後的版本中。它可用於嘗試還原有效的ASM磁碟頭(假設只有磁碟的前4k受到影響/覆蓋)。要還原ASM磁碟頭(假設自動ASM磁碟頭備份狀態良好),請執行以下步驟:


備份該磁碟前52M資料

[grid@dbaasm ~]$ dd if=/dev/oracleasm/disks/ASMDISK2 of=/tmp/ASMDISK2.dump bs=1048576 count=50
50+0 records in
50+0 records out
52428800 bytes (52 MB) copied, 0.667474 seconds, 78.5 MB/s

收集分配單元大小(kfdhdb.ausize公司)來自另一個正常磁碟成員(來自同一受影響的磁碟組):


[grid@dbaasm ~]$ kfed read /dev/oracleasm/disks/ASMDISK1  | egrep 'ausize|dsknum|dskname|grpname|fgname'  
kfdhdb.dsknum:                        0 ; 0x024: 0x0000
kfdhdb.dskname:                ASMDISK1 ; 0x028: length=8
kfdhdb.grpname:                    DATA ; 0x048: length=4
kfdhdb.fgname:                 FG1_SAN1 ; 0x068: length=8
kfdhdb.ausize:                  
2097152
 ; 0x0bc: 0x00200000



修復ASMDISK2

[grid@dbaasm ~]$ kfed repair /dev/oracleasm/disks/ASMDISK2  ausz=2097152

驗證:

[grid@dbaasm ~]$  kfed read /dev/oracleasm/disks/ASMDISK2  | head -40
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:              2147483650 ; 0x008: disk=2
kfbh.check:                  4052202307 ; 0x00c: 0xf187b343
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: ORCLDISKASMDISK2 ; 0x000: length=16
kfdhdb.driver.reserved[0]:   1145918273 ; 0x008: 0x444d5341
kfdhdb.driver.reserved[1]:    843797321 ; 0x00c: 0x324b5349
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:                186647296 ; 0x020: 0x0b200300
kfdhdb.dsknum:                        2 ; 0x024: 0x0002
kfdhdb.grptyp:                        2 ; 0x026: KFDGTP_NORMAL
kfdhdb.hdrsts:                        3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname:                ASMDISK2 ; 0x028: length=8
kfdhdb.grpname:                    DATA ; 0x048: length=4
kfdhdb.fgname:                 FG2_SAN2 ; 0x068: length=8
kfdhdb.capname:                         ; 0x088: length=0
kfdhdb.crestmp.hi:             32974423 ; 0x0a8: HOUR=0x17 DAYS=0x12 MNTH=0x9 YEAR=0x7dc
kfdhdb.crestmp.lo:           1180930048 ; 0x0ac: USEC=0x0 MSEC=0xe4 SECS=0x26 MINS=0x11
kfdhdb.mntstmp.hi:             33003184 ; 0x0b0: HOUR=0x10 DAYS=0x15 MNTH=0x5 YEAR=0x7de
kfdhdb.mntstmp.lo:           1230240768 ; 0x0b4: USEC=0x0 MSEC=0xff SECS=0x15 MINS=0x12
kfdhdb.secsize:                     512 ; 0x0b8: 0x0200
kfdhdb.blksize:                    4096 ; 0x0ba: 0x1000
kfdhdb.ausize:                  2097152 ; 0x0bc: 0x00200000
kfdhdb.mfact:                    228480 ; 0x0c0: 0x00037c80
kfdhdb.dsksize:                    9769 ; 0x0c4: 0x00002629
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
.

mount:


alter 
diskgroup DATA mount;


注意:

只有受影響磁碟的前4K被覆蓋/擦除/重疊 -- asm磁碟中只備份了那點資料,如果損壞較多,無法恢復,且還原力度較大

ASM磁碟頭備份狀態良好


壞的磁碟頭資訊:

[grid@dbaasm ~]$ kfed read /dev/oracleasm/disks/ASMDISK2
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
000000000 00000000 00000000 00000000 00000000  [................]
  Repeat 255 times
KFED-00322: Invalid content encountered during block traversal: [kfbtTraverseBlock][Invalid OSM block type][][0]


磁碟頭備份規則:

AU SIZE :  備份塊:

 1  M              510

 2 M            1022

 4M       2046

8M      4094

16M      8190

32M     16382

64M   32766


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29487349/viewspace-2766704/,如需轉載,請註明出處,否則將追究法律責任。

相關文章