A Short Script to List Mappings of ASM Disks to Physical Devices

I got a warning mail from our Enterprise Manager Cloud Control, it says “Disk Device emcpowere1 is 98.468% busy.”. I logged into the server to see the busy disk. There were no related mount point points so it should be used by ASM, but because we use ASMLIB, I needed to query each ASM disk to see which physical device it’s mapped to.

If you have a few disks, it won’t take time to check each disk using “oracleasm querydisk -p” but we have over 10 disks so I wrote a short script to query all ASM disks:

I’m sure this script can be converted to a one-liner but I would prefer “readable” scripts. By the way, I used “head -2” to eliminate additional disk aliases, otherwise script could produce such an output:

After I wrote the script, I checked My Oracle Support and see that there was a better script using “kfed” tool. You may check MoS Doc ID 1098682.1 to get the script.

Please share this post Share on Facebook0Share on Google+0Share on LinkedIn0Share on Reddit0Tweet about this on Twitter

Gokhan Atil is a database administrator who has hands-on experience with both RDBMS and noSQL databases (Oracle, PostgreSQL, Microsoft SQL Server, Sybase IQ, MySQL, Cassandra, MongoDB and ElasticSearch), and strong background on software development. He is certified as Oracle Certified Professional (OCP) and is awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for his continuous contributions to the Oracle users community.

1 Comment

Leave Comment

Your email address will not be published. Required fields are marked *