Tuesday, December 18, 2012

How to get ASM disks and their associated physical device.

Does any one have any idea about how to get the ASM physical device name? even though its not DBAs responsibility, having knowledge on this could potentially decrease the unix admin's dependency!

OracleASM utility provides listdisk option to get the ASM disk. $ORACLEASM LISTDISK.   OracleASM also provides "querydisk" option to get the device info ORACLEASM QUERYDISK -d . But using this querydisk feature you can't get the actual path of the ASM device. Instead, it will return only major and minor number of the device for that label name


oracle:@lnxracdev /oracle >/etc/init.d/oracleasm querydisk -d DATA_DISK01
Disk "DATA_DISK01" is a valid ASM disk on device [253, 17]

In order to get the ASM physical device name we can use blkid linux command. This command provides all the device names for the associated ASM disk.

oracle:@lnxracdev /oracle > blkid | grep -i DATA_DISK01
/dev/mapper/data_disk1: LABEL="DATA_DISK01" TYPE="oracleasm"
/dev/sdd: LABEL="DATA_DISK01" TYPE="oracleasm"
/dev/sdak: LABEL="DATA_DISK01" TYPE="oracleasm"
/dev/sdbr: LABEL="DATA_DISK01" TYPE="oracleasm"
/dev/sdcy: LABEL="DATA_DISK01" TYPE="oracleasm"

In the above example /dev/mapper/data_disk1 is the actual device name for DATA_DISK01 and below four /dev/sd* are multipath naming conventions.

2 comments:

  1. How do you confirm that the 4 different disk are actually multipath represents a single disk and are not 4 different disk. I am expecting a command with which I can verify.

    ReplyDelete