备份asm disk header

kfed 或者 dd

kfed read /dev/asm_data1 > asm_data1.txt &&
kfed read /dev/asm_data2 > asm_data2.txt &&
kfed read /dev/asm_data3 > asm_data3.txt

dd if=/dev/asm_data1 of=/home/grid/asm_data1.dump bs=4096 count=1 &&
dd if=/dev/asm_data2 of=/home/grid/asm_data2.dump bs=4096 count=1 &&
dd if=/dev/asm_data3 of=/home/grid/asm_data3.dump bs=4096 count=1

模拟asm disk header头损坏

dd if=/dev/zero of=/dev/asm_data1  bs=4096 count=1

重新挂载报错

SQL> alter diskgroup data dismount;

Diskgroup altered.

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 "0" is missing from group number "2"
[+ASM1]@ht01[/home/grid]$dd if=/dev/zero of=/dev/asm_data1  bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.000907187 s, 4.5 MB/s

kfed 读报错
[+ASM1]@ht01[/home/grid]$kfed read /dev/asm_data1
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
7F06DD408400 00000000 00000000 00000000 00000000  [................]
  Repeat 255 times
KFED-00322: Invalid content encountered during block traversal: [kfbtTraverseBlock][Invalid OSM block type][][0]

amdu 抽取报错
[+ASM1]@ht01[/home/grid]$amdu -diskstring ' /dev/asm_data*' -extract data.259
amdu_2019_11_10_19_27_12/
AMDU-00204: Disk N0002 is in currently mounted diskgroup DATA
AMDU-00201: Disk N0002: '/dev/asm_data2'
AMDU-00204: Disk N0003 is in currently mounted diskgroup DATA
AMDU-00201: Disk N0003: '/dev/asm_data3'

asm disk header 3种修复方式
kfed repair /dev/asm_data1
kfed write /dev/asm_data1 te=asm_data1.txt
dd if=/home/grid/asm_data1.dump  of=/dev/asm_data1 bs=4096 count=1

抽取数据时候可以先抽取control,control信息记录在alert日志里
amdu -diskstring '/dev/asm_data*' -extract data.259
data.259 有磁盘组名称和file_number组成.
select name from v$datafile;
可以以此抽出

  

01-12 08:13