lsdg中的Usable_file_MB 为什么是负值?
作者:互联网
lsdg中的Usable_file_MB 为什么是负值?
Negative Values of USABLE_FILE_MB Due to the relationship between FREE_MB, REQUIRED_MIRROR_FREE_MB, and USABLE_FILE_MB, USABLE_FILE_MB can go negative. Although this is not necessarily a critical situation, it does mean that:
Depending on the value of FREE_MB, you may not be able to create new files.
The next failure may result in files with reduced redundancy.
If USABLE_FILE_MB becomes negative, it is strongly recommended that you add more space to the disk group as soon as possible.
[@more@]
- ASMCMD> lsdg
- State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
- MOUNTED NORMAL Y 512 4096 1048576 144069764 10904234 13097251 -1096508 0 DATA1/
- SQL> select FAILGROUP,sum(total_mb-free_mb ),count(*)
- 2 from v$asm_disk
- 3 where name is not null
- 4 group by FAILGROUP;
- FAILGROUP |SUM(TOTAL_MB-FREE_MB)| COUNT(*)
- ------------------------------------------------------------|---------------------|----------
- DATA1_FG1 | 66713856| 124
- DATA1_FG2 | 66713824| 124
复制代码
由于做了两路镜像, 总的可用空间是(Total_MB - Req_mir_free_MB)/2 即
(144069764-13097251)/2=65486256MB
我们看到, v$asm_disk中显示两个failgroup都占用了约66713856 MB, 那么差值
66713856 - 65486256=1227600MB是从哪里多出来的呢?
会不会跟 Usable_file_MB有关系?
由于lsdg的信息同时也在v$asm_diskgroup中,我们看一下doc中对这个视图的解释
V$ASM_DISKGROUP displays one row for every ASM disk group discovered by the ASM instance on the node.
TOTAL_MB
Total capacity of the disk group (in megabytes)
FREE_MB
Unused capacity of the disk group (in megabytes)
REQUIRED_MIRROR_FREE_MB
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
Amount of free space that can be safely utilized taking mirroring into account and yet be able to restore redundancy after a disk failure
总结一下:
1) V$ASM_DISKGROUP.TOTAL_MB 对应到lsdg中的Total_MB
它不会考虑到镜像的因素, 是把所有failgroup中所有磁盘的总空间
2) V$ASM_DISKGROUP.FREE_MB 对应到lsdg中的 Free_MB
同理,它也不会考虑到mirror因素, 指目前总的可用空间
3) REQUIRED_MIRROR_FREE_MB 指为了使diskgroup能在一个或多个磁盘损坏后能够恢复冗余(redundancy),磁盘组中应该保留的剩余空间.
4) USABLE_FILE_MB 指能被"安全"利用的总空间, 即在考虑到磁盘损坏后能够恢复以前的冗余水平的前提下,可以使用的空间
我们看一个例子
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED NORMAL N 512 4096 1048576 144069764 42723226 13097251 14812987 0 DATA1/
(144069764-13097251)/2
按上面解释可知
这个两路镜像的diskgroup中
可以使用的总空间(不考虑oracle所说的安全使用的情况)为 144069764/2=72034882MB
<--------初始部署时,以这个值来判断容量
目前可以使用的总空间(不考虑到安全使用)为42723226/2=21361613MB
<---------在使用一段时间后,用这个值来判断可用容量
可以安全使用的总空间是 (144069764-13097251)/2=65486256.5 MB
目前可以安全使用的空间是(42723226-13097251)/2=14812987.5MB, 即Usable_file_MB 的值
如果这个值为负值,说明Free_MB < Req_mir_free_MB , 即磁盘组如果有一个磁盘失效,是不能有效恢复成redundancy的.
处在"不安全"的状态下.
在实际运营中,有磁盘失败时,一般都不是依赖于asm在现有online磁盘上基础上去恢复冗余,而是马上加新的存储(或者利用备用的设备),add disk之后再保证它达
到失败之前的冗余级别.
所以,Usable_file_MB 只是反映了当前"安全可利用的剩余空间", 只要free_mb为正,就没有问题.
标签:lsdg,Usable,MB,free,FREE,file,disk 来源: https://blog.51cto.com/lhrbest/2698029