Oracle RAC ASM disk header 备份恢复与重建示例说明

select * from dba_data_files;
col name format a15
col failgroup format a20
col path format a30
oracle KFED 和 KFOD 工具说明
1. Check v$asm_disk.header_status toverify that the disk header is in a “MEMBER” state.检查asmdisk header 的状态。
   select path,header_status from v$asm_disk;
kfed merge /dev/raw/raw5 text=/u01/datap1disker

1.1 编译KFED:
[oracle@rac2 lib]$cd $ORACLE_HOME/rdbms/lib
[oracle@rac2 lib]$ make -f ins_rdbms.mk ikfed

1.2查看KFED 位置:
[oracle@rac2 lib]$ which kfed
mv /u01/oracle/db/rdbms/lib/kfed /u01/oracle/db/bin/kfed

1.3 KFED 命令使用:
[oracle@rac2 lib]$ ./kfed -h  --查看KFED 帮助
select group_number,disk_number,mount_status,header_status,state,name,path from  v$asm_disk;//--查看ASM磁盘组的情况

select dg.group_number "g.no",dg.name,d.disk_number,d.mount_status,d.header_status,dg.type,d.name,d.path
from v$asm_disk d,v$asm_diskgroup dg where dg.group_number=d.group_number;
--从系统层面上查看:
[oracle@rac2 ~]$ ls -lrt /dev/oracleasm/disks/*
1.4--使用KFED查看ASM磁盘组:  ./kfed read /dev/oracleasm/disks/DATA1 text=/u01/datap1.txt

2.3 开始DD 备份
select name,path from v$asm_disk;
dd if=/dev/oracleasm/disks/VOL1 of=/u01/datap1header bs=4096 count=1
dd if=/dev/oracleasm/disks/VOL2 of=/u01/fraheader bs=4096 count=1
2.4 停掉ASM 实例
SYS@anqing2(rac2)> select name,state,type from v$asm_diskgroup;
/u01/oracle/oracle/product/10.2.0/crs/bin/crs_stat -t -v
/u01/oracle/oracle/product/10.2.0/crs/bin/srvctl stop instance -d orcl -i orcl2
[oracle@rac2 u01]$ /u01/oracle/oracle/product/10.2.0/crs/bin/srvctl stop asm -n rac3

2.5 模拟diskheader 故障
[oracle@rac2 u01]$ dd if=/dev/zero of=/dev/oracleasm/disks/VOL1 bs=4096 count=1

2.6 用KFED 查看此时的diskheader
[oracle@rac2 u01]$ kfed read /dev/oracleasm/disks/VOL1

2.7 启动ASM 实例
[oracle@rac2 u01]$ export ORACLE_SID=+ASM2
2.8 用之前的备份恢复
dd if=/u01/datap1header of=/dev/oracleasm/disks/VOL1 bs=4096 count=1
2.9 用KFED 验证diskheader
[oracle@rac2 u01]$ ./kfed read //dev/oracleasm/disks/VOL1

您的回应...

也许你感兴趣

换一批

热门标签

更多