ITPub博客

首页 > 数据库 > Oracle > normal redundancy Diskgroup里required_mirror_free_mb值的变化规律

normal redundancy Diskgroup里required_mirror_free_mb值的变化规律

原创 Oracle 作者:oliseh 时间:2014-09-29 23:30:22 0 删除 编辑

环境:Oracle 11g R2 GI Standalone Server

实验目的:v$asm_diskgroup. REQUIRED_MIRROR_FREE_MB值随不同的Failgroup策略所组成的Normal Redundancy Diskgroup而变化的规律,关于REQUIRED_MIRROR_FREE_MB的取值ASM Guide中是这样定义的,强调了是在不加存储的情况下为了能restore redundancy所必须留出的空闲容量:

REQUIRED_MIRROR_FREE_MB indicates the amount of space that must be available in a disk group to restore full redundancy after the worst failure that can be tolerated by the disk group without adding additional storage

ASM disk包括5hdiskpower

/dev/rhdiskpower5      0DCB 09C:1 16B:C10 2-Way Mir     N/Grp'd  (M) RW   46478

/dev/rhdiskpower6      0DCF 09C:1 01D:D4  2-Way Mir     N/Grp'd  (M) RW   46478

/dev/rhdiskpower7      0DD3 09C:1 02C:DA  2-Way Mir     N/Grp'd  (M) RW   46478

/dev/rhdiskpower8      0DD7 09C:1 16A:D12 2-Way Mir     N/Grp'd  (M) RW   46478

/dev/rhdiskpower9      0DDB 09C:1 16D:D1  2-Way Mir     N/Grp'd  (M) RW   46478

 

场景1:两个Failgroup,每个Failgroup一块磁盘

create diskgroup chhdg1 normal redundancy disk '/dev/rhdiskpower5','/dev/rhdiskpower6' attribute 'compatible.asm'='11.2.0.0.0';

 

select * from v$asm_diskgroup where name='CHHDG1' --required_mirror_free_mb值为0

     GROUP_NUMBER   NAME       SECTOR_SIZE   BLOCK_SIZE     ALLOCATION_UNIT_SIZE         STATE        TYPE         TOTAL_MB         FREE_MB          HOT_USED_MB       COLD_USED_MB     REQUIRED_MIRROR_FREE_MB      USABLE_FILE_MB    OFFLINE_DISKS         COMPATIBILITY        DATABASE_COMPATIBILITY    VOTING_FILES

  1  CHHDG1  512  4096         1048576  MOUNTED       NORMAL 92954       92848       0       106  0       46424       0       11.2.0.0.0         10.1.0.0.0         N

结论:一共只有两块盘,坏掉一块只剩一块,无论如何都无法实现normal redundancyREQUIRED_MIRROR_FREE_MB=0

 

场景2:两个Failgroup,第一个Failgroup一块磁盘,第二个Failgroup两块磁盘

drop diskgroup chhdg1;

create diskgroup chhdg1 normal redundancy disk '/dev/rhdiskpower5' failgroup fg1 disk '/dev/rhdiskpower6', '/dev/rhdiskpower7' attribute 'compatible.asm'='11.2.0.0.0';

 

select * from v$asm_diskgroup where name='CHHDG1' --required_mirror_free_mb值为最小的那个failgroup大小

GROUP_NUMBER   NAME       SECTOR_SIZE   BLOCK_SIZE     ALLOCATION_UNIT_SIZE         STATE        TYPE         TOTAL_MB         FREE_MB          HOT_USED_MB       COLD_USED_MB     REQUIRED_MIRROR_FREE_MB      USABLE_FILE_MB    OFFLINE_DISKS         COMPATIBILITY        DATABASE_COMPATIBILITY    VOTING_FILES

1       CHHDG1  512  4096         1048576  MOUNTED       NORMAL 139431     139323     0       108  46477       46423       0       11.2.0.0.0         10.1.0.0.0         N

结论:两个Failgroup是比较特殊的情况, Oracle文档中只提及Normal redundancy disk group with more than two failure groups的情况下会以最大的那个Failgroup大小作为REQUIRED_MIRROR_FREE_MB的值。在此例中可以看到两个Failgroup 的情况下,以最小的那个Failgroup作为REQUIRED_MIRROR_FREE_MB的取值,所有两个Failgroup组成的normal redundancy diskgroup对应的REQUIRED_MIRROR_FREE_MB取值一定都是一块盘的大小。

 

场景3:两个Failgroup,每个Failgroup各两块磁盘

drop diskgroup chhdg1;

create diskgroup chhdg1 normal redundancy failgroup fg1 disk '/dev/rhdiskpower5','/dev/rhdiskpower6' failgroup fg2 disk '/dev/rhdiskpower7','/dev/rhdiskpower8' attribute 'compatible.asm'='11.2.0.0.0';

 

select * from v$asm_diskgroup where name='CHHDG1'

GROUP_NUMBER   NAME       SECTOR_SIZE   BLOCK_SIZE     ALLOCATION_UNIT_SIZE         STATE        TYPE         TOTAL_MB         FREE_MB          HOT_USED_MB       COLD_USED_MB     REQUIRED_MIRROR_FREE_MB      USABLE_FILE_MB    OFFLINE_DISKS         COMPATIBILITY        DATABASE_COMPATIBILITY    VOTING_FILES

1       CHHDG1  512  4096         1048576  MOUNTED       NORMAL 185908     185798     0       110  46477       69660       0       11.2.0.0.0         10.1.0.0.0         N

结论:required_mirror_free_mb值为最小的那个failgroup里一块盘的大小,之所以不是整个failgroup的大小,REQUIRED_MIRROR_FREE_MB 的值代表了不增加额外存储的情况下能达到的容错效果,所以在最保守的情况下当然是能够在一块盘Fail的情况下restore redundancy

 

场景4:两个Failgroup,第一个Failgroup两块磁盘,第二个Failgroup三块磁盘

SQL> drop diskgroup chhdg1;

 

Diskgroup dropped.

 

SQL> create diskgroup chhdg1 normal redundancy failgroup fg1 disk '/dev/rhdiskpower5','/dev/rhdiskpower6' failgroup fg2 disk '/dev/rhdiskpower7','/dev/rhdiskpower8','/dev/rhdiskpower9' attribute 'compatible.asm'='11.2.0.0.0';

 

Diskgroup created.

 

SQL>select name,total_mb,free_mb,required_mirror_free_mb,usable_file_mb from v$asm_diskgroup where name='CHHDG1'

 

NAME       TOTAL_MB       FREE_MB          REQUIRED_MIRROR_FREE_MB      USABLE_FILE_MB

CHHDG1  232385     232273     46477       92898

 

结论:两个Failgroup的情况下,REQUIRED_MIRROR_FREE_MB只等于failgroup中单块盘的大小,

 

 

场景5:三个Failgroup,有两个Failgroup各两块磁盘,一个Failgroup只有一块磁盘

drop diskgroup chhdg1;

create diskgroup chhdg1 normal redundancy failgroup fg1 disk '/dev/rhdiskpower5','/dev/rhdiskpower6' failgroup fg2 disk '/dev/rhdiskpower7','/dev/rhdiskpower8' failgroup fg3 disk '/dev/rhdiskpower9' attribute 'compatible.asm'='11.2.0.0.0';

 

select * from v$asm_diskgroup where name='CHHDG1'

GROUP_NUMBER   NAME       SECTOR_SIZE   BLOCK_SIZE     ALLOCATION_UNIT_SIZE         STATE        TYPE         TOTAL_MB         FREE_MB          HOT_USED_MB       COLD_USED_MB     REQUIRED_MIRROR_FREE_MB      USABLE_FILE_MB    OFFLINE_DISKS         COMPATIBILITY        DATABASE_COMPATIBILITY    VOTING_FILES

1       CHHDG1  512  4096         1048576  MOUNTED       NORMAL 232385     232222     0       163  92954       69634       0       11.2.0.0.0         10.1.0.0.0         N

结论:required_mirror_free_mb值为最大的failgroup的大小

 

场景6:三个Failgroup,前两个Failgroup各一块磁盘,第三个Failgroup有三块磁盘

drop diskgroup chhdg1;

create diskgroup chhdg1 normal redundancy failgroup fg1 disk '/dev/rhdiskpower5' failgroup fg2 disk '/dev/rhdiskpower6' failgroup fg3 disk '/dev/rhdiskpower7','/dev/rhdiskpower8','/dev/rhdiskpower9' attribute 'compatible.asm'='11.2.0.0.0';

 

select * from v$asm_diskgroup where name='CHHDG1'

GROUP_NUMBER   NAME       SECTOR_SIZE   BLOCK_SIZE     ALLOCATION_UNIT_SIZE         STATE        TYPE         TOTAL_MB         FREE_MB          HOT_USED_MB       COLD_USED_MB     REQUIRED_MIRROR_FREE_MB      USABLE_FILE_MB    OFFLINE_DISKS         COMPATIBILITY        DATABASE_COMPATIBILITY    VOTING_FILES

1       CHHDG1  512  4096         1048576  MOUNTED       NORMAL 232385     232222     0       163  139431     46395       0       11.2.0.0.0         10.1.0.0.0         N

 

结论:required_mirror_free_mb值为最大的failgroup的大小--这个如何解释?显然不合情理啊,如何两个总量小于它的failgroup去冗余这个最大的Failgroup[C1] 

 

 

场景7:两个Failgroup,第一个Failgroup两块磁盘(256M512M),第二个Failgroup三块磁盘(768M1024M1280M)

SQL>  create diskgroup testdg22 normal redundancy failgroup f1 disk '/dev/rchhlv30','/dev/rchhlv31' failgroup f2 disk '/dev/rchhlv32','/dev/rchhlv33','/dev/rchhlv34' attribute 'compatible.asm'='11.2.0.0.0','compatible.rdbms'='11.2.0.0.0';

Diskgroup created.
SQL> select name,FAILGROUP,total_mb,path from v$asm_disk where group_number=13;

NAME                           FAILGROUP                        TOTAL_MB PATH
------------------------------ ------------------------------ ---------- ----------------------------------------
TESTDG22_0003                  F2                                   1024 /dev/rchhlv33
TESTDG22_0004                  F2                                   1280 /dev/rchhlv34
TESTDG22_0000                  F1                                    256 /dev/rchhlv30
TESTDG22_0001                  F1                                    512 /dev/rchhlv31
TESTDG22_0002                  F2                                    768 /dev/rchhlv32

SQL> select name,required_mirror_free_mb from  v$asm_diskgroup where name='TESTDG22';

NAME                           REQUIRED_MIRROR_FREE_MB
------------------------------ -----------------------
TESTDG22                                          1280

结论:required_mirror_free_mb值为最大的那块盘的大小,由上面这些例子可以看出当failgroup数量>2时,required_mirror_free_mb值等于最大的那个failgroup大小,当failgroup数量<3时且required_mirror_free_mb!=0的情况下,required_mirror_free_mb值等于最大的那块盘的大小

 


 [C1]询问oracle community的结果是对于normal/high redundancydiskgroup应该满足所有FG里的盘数相等、盘大小相等的设计原则。所以场景6这种情况下是不能保证坏盘情况下还能restore redundancy的要求

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/53956/viewspace-1285402/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
不仅仅专注Oracle database技术, member of SHOUG

注册时间:2014-04-06

  • 博文量
    128
  • 访问量
    1617266