High冗余的diskgroup,只有三个failgroup,其中的一个failgroup全部损坏
High冗余的diskgroup,总共只有三个failgroup,如果其中的一个failgroup全部损坏,该diskgroup能够完成ASM的rebalance?
带着这个疑问,做了如下测试:
1.创建high冗余的diskgroup,但只有三个failgroup,每个failgroup中有两块盘
create diskgroup data2 high redundancy failgroup fg1 disk '/dev/asm-high1','/dev/asm-high2' failgroup fg2 disk '/dev/asm-high3','/dev/asm-high4' failgroup fg3 disk '/dev/asm-high5','/dev/asm-high6'; |
2. 使用新增的diskgroup
create tablespace m01 datafile '+data2' size 200M; create tablespace m02 datafile '+data2' size 200M; create tablespace m03 datafile '+data2' size 200M; create tablespace m04 datafile '+data2' size 200M; create tablespace m05 datafile '+data2' size 200M; create tablespace m06 datafile '+data2' size 200M; create tablespace m07 datafile '+data2' size 200M; create tablespace m08 datafile '+data2' size 200M; create tablespace m09 datafile '+data2' size 200M; create tablespace m10 datafile '+data2' size 200M; create tablespace m11 datafile '+data2' size 200M; create tablespace m12 datafile '+data2' size 200M; create tablespace m13 datafile '+data2' size 200M; create tablespace m14 datafile '+data2' size 200M; create tablespace m15 datafile '+data2' size 200M; create tablespace m16 datafile '+data2' size 200M; create tablespace m17 datafile '+data2' size 200M; create tablespace m18 datafile '+data2' size 200M; create tablespace m19 datafile '+data2' size 200M; create tablespace m20 datafile '+data2' size 200M; |
3.查看ASM中磁盘的使用情况
SQL> select group_number, MOUNT_STATUS, HEADER_STATUS, NAME, PATH, FAILGROUP, TOTAL_MB, FREE_MB from v$asm_disk order by 1, 6,5;
GROUP_NUMBER MOUNT_STATUS HEADER_STATUS NAME PATH FAILGROUP TOTAL_MB FREE_MB ------------ --------------------- ------------------------------------ -------------------- -------------------- -------------------- ---------- ---------- 1 CACHED MEMBER DATA2_0000 /dev/asm-high1 FG1 2048 482 1 CACHED MEMBER DATA2_0001 /dev/asm-high2 FG1 2048 488 1 CACHED MEMBER DATA2_0002 /dev/asm-high3 FG2 2048 478 1 CACHED MEMBER DATA2_0003 /dev/asm-high4 FG2 2048 492 1 CACHED MEMBER DATA2_0004 /dev/asm-high5 FG3 2048 490 1 CACHED MEMBER DATA2_0005 /dev/asm-high6 FG3 2048 480 |
4.模拟磁盘损坏,将FG3这个failgroup中的磁盘全部下线。
alter diskgroup data2 offline disk DATA2_0004; alter diskgroup data2 offline disk DATA2_0005; |
5.时间超过disk_repair_time后,会自动删除FG3这个failgroup中所有的磁盘,并发起rebalance操作。
SQL> select * from gv$asm_operation;
INST_ID GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE ---------- ------------ --------------- ------------ ---------- ---------- ---------- ---------- ---------- ----------- -------------------- 1 1 REBAL WAIT 1 2 1 REBAL RUN 1 1 2390 5506 1841 1
SQL> /
no rows selected
SQL> |
6.再次查看磁盘状态。
GROUP_NUMBER MOUNT_STATUS NAME PATH FAILGROUP TOTAL_MB FREE_MB ------------ -------------- -------------------- -------------------- ------------ ---------- ---------- 0 CLOSED /dev/asm-high5 0 0 0 CLOSED /dev/asm-high6 0 0 1 CACHED DATA2_0000 /dev/asm-high1 FG1 2048 76 1 CACHED DATA2_0001 /dev/asm-high2 FG1 2048 75 1 CACHED DATA2_0002 /dev/asm-high3 FG2 2048 74 1 CACHED DATA2_0003 /dev/asm-high4 FG2 2048 77 1 MISSING _DROPPED_0004_DATA2 FG3 2048 76 1 MISSING _DROPPED_0007_DATA2 FG3 2048 75 |
可以看出,High冗余的diskgroup,总共只有三个failgroup,如果其中的一个failgroup全部损坏,该diskgroup能够完成ASM的rebalance,便该failgroup相关的信息还是在该diskgroup中,无法清除掉。
7.修复磁盘故障,重新加入到diskgroup中。
dd if=/dev/zero of=/dev/asm-high5 bs=1M count=100 dd if=/dev/zero of=/dev/asm-high6 bs=1M count=100
alter diskgroup data2 add failgroup fg3 disk '/dev/asm-high5','/dev/asm-high6'; |
此时,会触发ASM rebalance操作。
8.ASM rebalance完成后,检查 磁盘状态。
SQL> /
GROUP_NUMBER MOUNT_STATUS NAME PATH FAILGROUP TOTAL_MB FREE_MB ------------ -------------- -------------------- -------------------- ----------- ---------- ---------- 1 CACHED DATA2_0000 /dev/asm-high1 FG1 2048 77 1 CACHED DATA2_0001 /dev/asm-high2 FG1 2048 74 1 CACHED DATA2_0002 /dev/asm-high3 FG2 2048 75 1 CACHED DATA2_0003 /dev/asm-high4 FG2 2048 76 1 CACHED DATA2_0005 /dev/asm-high5 FG3 2048 900 1 CACHED DATA2_0006 /dev/asm-high6 FG3 2048 901 1 MISSING _DROPPED_0004_DATA2 FG3 2048 1223 1 MISSING _DROPPED_0007_DATA2 FG3 2048 1219
SQL> /
GROUP_NUMBER MOUNT_STATUS NAME PATH FAILGROUP TOTAL_MB FREE_MB ------------ ------------- -------------------- -------------------- ----------- ---------- ---------- 1 CACHED DATA2_0000 /dev/asm-high1 FG1 2048 76 1 CACHED DATA2_0001 /dev/asm-high2 FG1 2048 75 1 CACHED DATA2_0002 /dev/asm-high3 FG2 2048 75 1 CACHED DATA2_0003 /dev/asm-high4 FG2 2048 76 1 CACHED DATA2_0005 /dev/asm-high5 FG3 2048 77 1 CACHED DATA2_0006 /dev/asm-high6 FG3 2048 74 |
可见,当High冗余的diskgroup恢复成3个failgroup后,以前的残余信息就会被清理干净。