diskgroup里和空间相关的几个字段的一些介绍

主要是涉及到v$asm_diskgroup里的4个字段,其中2个字段的含义不是很好理解,可以参考网上一个哥们写的一篇文章:

http://www.dbapub.net/bbs/viewthread.php?tid=278&extra=page%3D2

[@more@]

SQL> select group_number,disk_number,total_mb,free_mb,name,failgroup from v$asm_disk
2 where group_number=1
3 order by group_number,disk_number
4 ;

GROUP_NUMBER DISK_NUMBER TOTAL_MB FREE_MB NAME FAILGROUP
------------ ----------- ---------- ---------- -------------------- ----------
1 0 1024 560 DG1_0000 DG1_0001
1 1 1024 558 DG1_0001 DG1_0001
1 2 2048 1120 DG1_0002 DG1_0002
1 3 74 0 DISK9 DISK9

SQL>
--===============================
SQL> select sum(total_mb),sum(free_mb) from v$asm_disk where group_number=1;

SUM(TOTAL_MB) SUM(FREE_MB)
------------- ------------
4170 2238

SQL> set linesize 200
SQL> select name,type,total_mb,free_mb,required_mirror_free_mb,usable_file_mb from v$asm_diskgroup where group_number=1;

NAME TYPE TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
-------------------- --------------- ---------- ---------- ----------------------- --------------
DG1 NORMAL 4170 2238 2048 95

SQL>
--================================
ASMCMD> lsdg dg1
State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED NORMAL N N 512 4096 1048576 4170 2238 2048 95 0 DG1/
ASMCMD>
--=======================================
和diskgroup空间相关的几个字段有时候不太好理解,尤其是REQUIRED_MIRROR_FREE_MB和USABLE_FILE_MB:
TOTAL_MB NUMBER Total capacity of the disk group (in megabytes)
FREE_MB NUMBER Unused capacity of the disk group (in megabytes)
REQUIRED_MIRROR_FREE_MB NUMBER Amount of space that is required to be available in a given disk group in order to restore redundancy after one or more disk failures. The amount of space displayed in this column takes mirroring effects into account.
USABLE_FILE_MB NUMBER Amount of free space that can be safely utilized taking mirroring into account, and yet be able to restore redundancy after a disk failure
--=======================================
先看这4个字段之间的关系:
Total_MB就是diskgroup里所有的disk的空间总和,和mirror没有任何关系
Free_MB是diskgroup里所有的disk的free空间总和,和mirror也没有任何关系
REQUIRED_MIRROR_FREE_MB考虑了mirorr,是指为了使diskgroup能在一个或多个磁盘损坏后能够restore冗余(redundancy),磁盘组中应该保留的剩余空间.
但是针对我上面查询出来的数据我有些不是很理解我的系统diskgroup dg1有关disk sapce的情况:
dg1是normal redundancy type,dg1里一共有4块disk,其中有3个failgroup,failgroup DG1_0001里面
包含了2块disk,总容量是2g,failgroup DG1_0002里面有1块disk,容量是2g,从asm file里au
的使用情况来看,这2个failgroup是相互mirror的:
--=======================================
ASMCMD> pwd
+dg1/ASMDB/datafile
ASMCMD> ls
SYSAUX.264.741435571
SYSTEM.262.741435533
TEST.268.741441015
TEST.DBF
UNDOTBS1.263.741435561
USERS.266.741435583
test/
ASMCMD>
--=======================================
以asm file(是users表空间对应的datafile)266为例看看该file的au在disk上的data分布情况:
SQL> select group_kffxp,xnum_kffxp,lxn_kffxp,disk_kffxp,failgroup
2 from x$kffxp x,v$asm_disk d
3 where number_kffxp=266 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;

GROUP_KFFXP XNUM_KFFXP LXN_KFFXP DISK_KFFXP FAILGROUP
----------- ---------- ---------- ---------- ----------
1 0 0 0 DG1_0001
1 0 1 2 DG1_0002
1 1 0 1 DG1_0001
1 1 1 2 DG1_0002
1 2 0 2 DG1_0002
1 2 1 0 DG1_0001
1 3 0 2 DG1_0002
1 3 1 1 DG1_0001
1 4 0 1 DG1_0001
1 4 1 2 DG1_0002
1 5 0 0 DG1_0001
1 5 1 2 DG1_0002

已选择12行。

SQL>
--===================================
通过上面查询我们发现ASM FILE 266的au在failgroup DG1_0001和DG1_0002是相互mirror的,
因此就目前的dg1来说我认为是不需要REQUIRED_MIRROR_FREE_MB的,那么REQUIRED_MIRROR_FREE_MB目前的
大小是2048,正好和disk number 2也就是DG1_0002的大小相等,我觉得这不是巧合,这里我有些不是很理解
oracle这里到底是如何计算REQUIRED_MIRROR_FREE_MB的,如果现在disk DG1_0002损坏,因为有
failgroup DG1_0001包含的disk number 0和1,所以dg1依然可以正常使用...目前无法理解
--===================================
USABLE_FILE_MB=(Free_MB - REQUIRED_MIRROR_FREE_MB)/2 (除以2是因为dg1是normal redundancy,如果是high redundancy,那么除以3,
如果是external redundaync,那么除以1)
根据上面公式:USABLE_FILE_MB=(2238 - 2048)/2=95,使用dbca建库时显示的dg1的可用空间就是95m,这很要命
--===================================

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

转载于:http://blog.itpub.net/19602/viewspace-1045658/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值