Some useful Commands for ASM


I am sharing few useful commands related to ASM which can be used for DBA's.

1) Check if the ASM disk is a Member or not.

In the below example I am using condition to check the path because all my DISK name are configured with Instance name.

select path, header_status,name from v$asm_disk where header_status='MEMBER' and PATH like '%PROD%';
select path, header_status,name from v$asm_disk where header_status='FORMER' and PATH like '%PROD%';

2) List all DISK in ASM.

/usr/sbin/oracleasm listdisks 

3)  Find Serial Number for a DISK.

sudo /usr/local/bin/asm2serial "PROD_DATA01 PROD_DATA02"

PROD_DATA01 : 742b00000ac084 (/dev/mapper/inf01_asm_data08)
PROD_DATA02: 742b0000ac092 (/dev/mapper/inf01_asm_data09)

4) Find free and used space in DISKGROUP.

SELECT name, free_mb, total_mb, total_mb-free_mb "USED_MB", free_mb/total_mb*100 "%FREE" FROM v$asm_diskgroup;

5) Monitoring ASM Disk Operations

select GROUP_NUMBER, OPERATION, STATE, ACTUAL, SOFAR, EST_MINUTES from v$asm_operation;

If there is a operating going on (like rebalancing) the query will return some rows.

GROUP_NUMBER OPERA STAT    ACTUAL  SOFAR      EST_MINUTES
------------ ----- ---- ---------- ---------- -----------
1           REBAL RUN           1         10          12


6) Find ASM Disks

select GROUP_NUMBER, NAME, PATH, STATE, TOTAL_MB, FREE_MB from v$asm_disk;