我们知道asm里提供了3种redundancy方式:normal,high和external,同事它又提供了template的概念,template里也有redundancy的概念,而且template的redundancy特性优先发挥作用与diskgroup的redundancy特性,这样其实就存在一个问题,当diskgroup处于normal方式并且只存在2个failgroup而位于该diskgroup
的asm file的redundancy方式是high的时候,oracle又是如何解决这一矛盾的呢
[@more@]ASMCMD> ls -l control01.ctl
Type Redund Striped Time Sys Name
N control01.ctl => +DG1/ASMDB/CONTROLFILE/Current.256.741435505
ASMCMD> pwd
+dg1/asmdb
ASMCMD>
--========================
SQL> col type format a15
SQL> select group_number,file_number,type,redundancy,striped,redundancy_lowered from v$asm_file where file_number=256 and group_number=1;
GROUP_NUMBER FILE_NUMBER TYPE REDUNDANCY STRIPED RE
------------ ----------- --------------- ------------ ------------ --
1 256 CONTROLFILE HIGH FINE Y
--=====================================
SQL> col name format a20
SQL> select * from v$asm_template where group_number=1 and name='CONTROLFILE';
GROUP_NUMBER ENTRY_NUMBER REDUNDANCY STRIPE SY NAME
------------ ------------ ------------ ------------ -- --------------------
1 2 HIGH FINE Y CONTROLFILE
--=========================================
SQL> select group_number,type from v$asm_diskgroup;
GROUP_NUMBER TYPE
------------ ---------------
1 NORMAL
2 EXTERN
3 EXTERN
4 NORMAL
SQL>
--===============================
SQL> col failgroup format a10
SQL> select group_kffxp,xnum_kffxp,lxn_kffxp,disk_kffxp,failgroup
2 from x$kffxp x,v$asm_disk d
3 where number_kffxp=256 and group_kffxp=1
4 and d.disk_number(+)=x.disk_kffxp
5 and d.group_number(+)=x.group_kffxp
6 order by xnum_kffxp,lxn_kffxp,disk_kffxp,failgroup
7 ;
GROUP_KFFXP XNUM_KFFXP LXN_KFFXP DISK_KFFXP FAILGROUP
----------- ---------- ---------- ---------- ----------
1 0 0 1 DG1_0001
1 0 1 2 DG1_0002
1 0 2 65534
1 1 0 0 DG1_0001
1 1 1 2 DG1_0002
1 1 2 65534
1 2 0 2 DG1_0002
1 2 1 0 DG1_0001
1 2 2 65534
1 3 0 1 DG1_0001
1 3 1 2 DG1_0002
1 3 2 65534
1 4 0 2 DG1_0002
1 4 1 1 DG1_0001
1 4 2 65534
1 5 0 0 DG1_0001
1 5 1 2 DG1_0002
1 5 2 65534
1 6 0 2 DG1_0002
1 6 1 0 DG1_0001
1 6 2 65534
1 7 0 2 DG1_0002
1 7 1 1 DG1_0001
1 7 2 65534
已选择24行。
SQL>
--=============================
由于controlfile01.ctl所在的diskgroup dg1的redundancy方式是normal,而且
dg1里面有2个failgroup,事实上尽管controlfile01.ctl继承了系统自带的模板
CONTROLFILE的属性REDUNDANCY:HIGH,但是由于dg1里目前有2个failgroup,所以
controlfile01.ctl的data copy其实还是2份,也就是normal mirror,而不是HIGH
,这一点从上面的查询v$asm_file的字段redundancy_lowered=Y其实也可以看的出来:
视图v$asm_file的字段redundancy_lowered的解释如下:
REDUNDANCY_LOWERED VARCHAR2(1) Indicates whether a file has lower redundancy than what was expected (Y) or not (N). Redundancy is said to have been lowered for a file when one or more data extents in that file are not mirrored at the level specified by the administrator. In case of unprotected files, data extents could be missing altogether. Another possible value for this column is (U), which means that it is unknown.
--==============================
所以说congtrolfile的data copy其实最终还是normal mirror也就是存在2份,但是我们通过
上面的x$kffxp x,v$asm_disk d关联查询出来的是3个au,但是我们注意到有1个DISK_KFFXP
=65534,对应的FAILGROUP为null,也说明了这一点,其实其中LXN_KFFXP=2对应的AU目前应该是
一个虚的,下面我们再来增加一块disk,同事增加一个failgroup,之后看看情况:
--=============================
SQL> alter diskgroup dg1 add disk 'g:asmdiskDISK9' name disk9;
磁盘组已变更。
SQL> select group_number,disk_number,name,failgroup from v$asm_disk
2 where group_number=1
3 order by group_number,disk_number
4 ;
GROUP_NUMBER DISK_NUMBER NAME FAILGROUP
------------ ----------- -------------------- ----------
1 0 DG1_0000 DG1_0001
1 1 DG1_0001 DG1_0001
1 2 DG1_0002 DG1_0002
1 3 DISK9 DISK9
SQL>
--================================
SQL> select group_kffxp,xnum_kffxp,lxn_kffxp,disk_kffxp,failgroup
2 from x$kffxp x,v$asm_disk d
3 where number_kffxp=256 and group_kffxp=1
4 and d.disk_number(+)=x.disk_kffxp
5 and d.group_number(+)=x.group_kffxp
6 order by xnum_kffxp,lxn_kffxp,disk_kffxp,failgroup
7 ;
GROUP_KFFXP XNUM_KFFXP LXN_KFFXP DISK_KFFXP FAILGROUP
----------- ---------- ---------- ---------- ----------
1 0 0 1 DG1_0001
1 0 1 2 DG1_0002
1 0 2 3 DISK9
1 1 0 0 DG1_0001
1 1 1 2 DG1_0002
1 1 2 3 DISK9
1 2 0 2 DG1_0002
1 2 1 0 DG1_0001
1 2 2 3 DISK9
1 3 0 1 DG1_0001
1 3 1 2 DG1_0002
GROUP_KFFXP XNUM_KFFXP LXN_KFFXP DISK_KFFXP FAILGROUP
----------- ---------- ---------- ---------- ----------
1 3 2 3 DISK9
1 4 0 2 DG1_0002
1 4 1 1 DG1_0001
1 4 2 3 DISK9
1 5 0 0 DG1_0001
1 5 1 2 DG1_0002
1 5 2 3 DISK9
1 6 0 2 DG1_0002
1 6 1 0 DG1_0001
1 6 2 3 DISK9
1 7 0 2 DG1_0002
GROUP_KFFXP XNUM_KFFXP LXN_KFFXP DISK_KFFXP FAILGROUP
----------- ---------- ---------- ---------- ----------
1 7 1 1 DG1_0001
1 7 2 3 DISK9
已选择24行。
SQL>
--============================
添加了一块disk之后,准确的说是多了一个failgroup:DISK9,从上面查询可以看的出来系统自动对controlfile做了
HIGH redundancy,同事我们注意到下面查询v$asm_file的字段redundancy_lowered的值也变成了N
SQL> select group_number,file_number,type,redundancy,striped,redundancy_lowered from v$asm_file where file_number=256 and group_number=1;
GROUP_NUMBER FILE_NUMBER TYPE REDUNDANCY STRIPED RE
------------ ----------- --------------- ------------ ------------ --
1 256 CONTROLFILE HIGH FINE N
SQL>
--==================================
这里其实已经非常清楚了,asm file的redundancy方式其实和diskgroup的redundancy没有太多的关系(除了diskgroup 的external方式),只和diskgroup里的failgroup的数量有关系。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/19602/viewspace-1045656/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/19602/viewspace-1045656/