Oracle兵器谱上古神器之-KFED(六)
c: 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
通过对比我们可以发现这两者的内容是一摸一样的。那么我们可以做个试验,
就是把0位置的信息破坏掉,然后用510位置的信息进行还原,看看是否可以
成功还原DISK。
就是把0位置的信息破坏掉,然后用510位置的信息进行还原,看看是否可以
成功还原DISK。
3. KFED备份header信息
为了安全,我们在使用KFED之前还是停掉ASM针对设备做个物理备份。
[oracle@gtser1 lib]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.5.0 - Production on Sat Mar 2 16:40:05 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate;
ASM diskgroups dismounted
ASM instance shutdown
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release
10.2.0.5.0 - 64bit Production
10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@gtser1 lib]$ dd if=/dev/raw/raw1 of=/tmp/raw1 bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.000461594 seconds, 8.9 MB/s
好了,接下来启动ASM进行在线KFED备份,KFED支持在线编辑,虽然
10.2.0.5支持header的自动备份和快捷修复(我们也会演示到),但是我
们想通过510的信息来恢复0的信息以还原DISK。
10.2.0.5支持header的自动备份和快捷修复(我们也会演示到),但是我
们想通过510的信息来恢复0的信息以还原DISK。
[oracle@gtser1 lib]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.5.0 - Production on Sat Mar 2 16:44:51 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 125829120 bytes
Fixed Size 2094512 bytes
Variable Size 98568784 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release
10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@gtser1 lib]$ asmcmd lsdg
State Type Rebal Unbal Sector Block AU Total_MB Free_MB
Req_mir_free_MB Usable_file_MB Offline_disks Name
Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED EXTERN N N 512 4096 1048576 2048 928
0 928 0 DATA01/
0 928 0 DATA01/
MOUNTED EXTERN N N 512 4096 1048576 2048 1964
0 1964 0 FRA/
0 1964 0 FRA/
[oracle@gtser1 lib]$ kfed read /dev/raw/raw1 te=/tmp/raw1.head
[oracle@gtser1 lib]$ kfed read /dev/raw/raw1 blkn=510 te=/tmp
/raw1.head.bak
/raw1.head.bak
接下来我们人为的破坏disk的内容:
[oracle@gtser1 lib]$ dd if=/dev/zero of=/dev/raw/raw1 bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.000424761 seconds, 9.6 MB/s
[oracle@gtser1 lib]$ kfed read /dev/raw/raw1 te=/tmp/raw1.head.bad
[oracle@gtser1 lib]$ cat /tmp/raw1.head.bad
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 0 ; 0x001: 0x00
kf