Show ASM Disk Usage
#!/usr/bin/ksh
#
# Title :       asmuse.ksh
# Description : Show ASM disk usage.
# Usage :       Configure the ASM SID & ASM Oracle Home before running.
#
#

export ORACLE_SID=<Enter ASM SID here>
export ORACLE_HOME=<Enter full path to ASM Oracle Home here>
export PATH=${PATH}:${ORACLE_HOME}/bin
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib
export LC_ALL=en_GB

echo
echo
echo "  ASM Disk     % Full     Used (MB)       Free (MB)        Total (MB) "
echo "======================================================================"

asmcmd lsdg | \
 nawk -v sq="'" 'BEGIN { getline } {
        printf"  %s     \t %d%% \t %9"sq"d \t %9"sq"d \t %12"sq"d \n",$13,100-100*($9/$8),$8-$9,$9,$8
   }'

echo
echo

--------------------------------------------------------------------------------
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License