Extract ASM disk info
If you are asked to provide an extract of SAN allocation, then the following query can be used to provide the breakdown
ASM Disk Info Query
$ sqlplus / as sysdba
set pages 200 lines 250 --colsep ,
col DiskPath format a50
col diskname format a20
col diskgroup_name format a20
break on Diskgroup_name skip 2
compute sum label 'Group_Size-GB' of total_gb on Diskgroup_name
compute sum label 'Group_Size-GB' of Used_GB on Diskgroup_name
compute sum label 'Group_Size-GB' of Free_GB on Diskgroup_name
compute Avg label 'Free_percent%' of free_percent on Diskgroup_name
select a.name Diskgroup_name,
b.name diskname,
b.path DiskPath,
round((b.total_mb/1024),2) Total_GB,
round(((b.total_mb-b.free_mb)/1024),2) Used_GB,
round((b.free_mb/1024),2) Free_GB,
100 - round((((b.total_mb - b.free_mb)*100)/b.total_mb),2) free_percent
from v$asm_diskgroup a,
v$asm_disk b
where a.group_number=b.group_number
order by 1,
decode(a.name, 'DATA',to_number(substr(b.name,5,2)),
'FLASH',to_number(substr(b.name,6,2)),
'MGMT',to_number(substr(b.name,6,2)),
'FAST',to_number(substr(b.name,5,2))
);
Sample Output
DISKGROUP_NAME DISKNAME DISKPATH TOTAL_GB USED_GB FREE_GB FREE_PERCENT
-------------------- --------- ----------------- ---------- ---------- ---------- ------------
DATA DATA1 /dev/emcpowerb 136.16 121.71 14.45 10.61
DATA2 /dev/emcpowerc 136.16 121.7 14.45 10.62
DATA3 /dev/emcpowerd 136.16 121.71 14.45 10.61
******************** ---------- ---------- ---------- ------------
Free_percent% 10.6133333
Group_Size-GB 408.48 365.12 43.35
FAST FAST1 /dev/emcpowere 136.16 126.33 9.83 7.22
******************** ---------- ---------- ---------- ------------
Free_percent% 7.22
Group_Size-GB 136.16 126.33 9.83
MGMT MGMT_0000 /dev/emcpowera 17.02 .21 16.81 98.77
MGMT_0001 /dev/emcpowerf 17.02 .18 16.84 98.95
******************** ---------- ---------- ---------- ------------
Free_percent% 98.86
Group_Size-GB 34.04 .39 33.65