最近遇到幾次ASM DATA HEADER出問題導致DISK GROUP 不能正常的MOUNT,是的資料庫不能正常工作,從來帶來了無窮的麻煩,這個時候心想,如果我做了ASM DATA HEADER的備份該多好啊,可惜世上沒有後悔藥,建議大家檢查下自己的ASM庫,ASM HEADER是否已經做了備份,如果沒有請及時處理下.這裡實驗提供了dd和kfed備份和恢複ASM HEADER
查詢ASM相關資訊
SQL> select group_number,name,state,total_mb,free_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB FREE_MB
------------ ------------------------------ ---------- ---------- ----------
1 DATA MOUNTED 2046 1314
2 XIFENFEI MOUNTED 6141 4378
SQL> select group_number,DISK_NUMBER,PATH,STATE from v$asm_disk;
GROUP_NUMBER DISK_NUMBER PATH STATE
------------ ----------- ------------------------------ ----------------
1 1 /dev/oracleasm/disks/VOL2 NORMAL
1 0 /dev/oracleasm/disks/VOL1 NORMAL
2 1 /dev/oracleasm/disks/VOL4 NORMAL
2 0 /dev/oracleasm/disks/VOL3 NORMAL
找出ASM DISK對應磁碟分割
[grid@rac1 ~]$ /etc/init.d/oracleasm querydisk -d VOL1
Disk "VOL1" is a valid ASM disk on device [8,33]
[grid@rac1 ~]$ ll /dev |grep 8|grep 33
brw-r----- 1 root disk 8, 33 Apr 17 11:37 sdc1
[grid@rac1 ~]$ /etc/init.d/oracleasm querydisk -d VOL2
Disk "VOL2" is a valid ASM disk on device [8,34]
[grid@rac1 ~]$ ll /dev |grep 8|grep 34
brw-r----- 1 root disk 8, 34 Apr 17 11:37 sdc2
[grid@rac1 ~]$ /etc/init.d/oracleasm querydisk -d VOL3
Disk "VOL3" is a valid ASM disk on device [8,17]
[grid@rac1 ~]$ ll /dev |grep 8,|grep 17
brw-r----- 1 root disk 8, 17 Apr 17 11:37 sdb1
[grid@rac1 ~]$ /etc/init.d/oracleasm querydisk -d VOL4
Disk "VOL4" is a valid ASM disk on device [8,18]
[grid@rac1 ~]$ ll /dev |grep 8,|grep 18
brw-r----- 1 root disk 8, 18 Apr 17 11:37 sdb2
備份ASM HEADER資訊(備份XIFENFEI磁碟組)
--dd方式備份
[root@rac1 backup_asmheader]# dd if=/dev/sdb1 of=vol3header.dd bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.000143581 seconds, 28.5 MB/s
[root@rac1 backup_asmheader]# dd if=/dev/sdb2 of=vol4header.dd bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.000147727 seconds, 27.7 MB/s
--kfed方式備份
[grid@rac1 backup_asmheader]$ kfed read /dev/oracleasm/disks/VOL3 text=vol3header.txt
更多精彩內容:http://www.bianceng.cn/database/Oracle/
[grid@rac1 backup_asmheader]$ more vol3header.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: 2147483648 ; 0x008: disk=0
kfbh.check: 198826195 ; 0x00c: 0x0bd9d8d3
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: ORCLDISKVOL3 ; 0x000: length=12
kfdhdb.driver.reserved[0]: 860639062 ; 0x008: 0x334c4f56
kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000