The oldest posts, are written in Italian. If you are interested and you want read the post in English, please use Google Translator. You can find it on the right side. If the translation is wrong, please email me: I'll try to translate for you.

venerdì, marzo 11, 2016

lsamsdsk, AIX version (ENG)

In order to associate the ASM disk in /dev/oracle directory with raw device, I made follofing script


export DISK_ASM_DIR=/dev/oracle
export DISK_OS_DIR=/dev
export DISK_OS_TYPE=crw #also brw

echo "ASM Disk        Device               Mj,Mn"
echo "--------------  -----------------    ---------"
for _asm_disk_name in $(ls -l $DISK_ASM_DIR |grep -v total |awk '{print $(NF)}'); do
  asm_major_nr=$(ls -l ${DISK_ASM_DIR}/${_asm_disk_name} |awk 'BEGIN {FS=","}{print $1}'|awk '{print $NF}')
  asm_minor_nr=$(ls -l ${DISK_ASM_DIR}/${_asm_disk_name} |awk 'BEGIN {FS=","}{print $2}'|awk '{printf "%3s", $1}')
  os_disk=$(ls -l $DISK_OS_DIR |grep "${asm_major_nr},${asm_minor_nr}"|grep ^${DISK_OS_TYPE}|awk '{print $NF}')

  printf "%-15s %-20s [%-s,%3s]\n" $_asm_disk_name ${DISK_OS_DIR}/$os_disk ${asm_major_nr} ${asm_minor_nr}

This is an example of output

ASM Disk        Device               Mj,Mn
--------------  -----------------    ---------
DWHBOpDSK01     /dev/rhdisk93        [17, 92]
DWHBOpDSK02     /dev/rhdisk94        [17, 94]
DWHDBS.ocr      /dev/rhdisk4         [17,  4]
DWHDBS.ovd      /dev/rhdisk11        [17, 11]
DWHICTpDSK01    /dev/rhdisk58        [17, 57]
DWHICTpDSK02    /dev/rhdisk51        [17, 51]
DWHICTpDSK03    /dev/rhdisk59        [17, 59]
DWHICTpDSK04    /dev/rhdisk60        [17, 60]
DWHICTpDSK05    /dev/rhdisk52        [17, 52]
DWHICTpDSK06    /dev/rhdisk53        [17, 53]
DWHICTpDSK07    /dev/rhdisk54        [17, 54]
DWHICTpDSK08    /dev/rhdisk55        [17, 55]
DWHICTpDSK09    /dev/rhdisk61        [17, 62]
DWHICTpDSK10    /dev/rhdisk62        [17, 61]
DWHICTpDSK11    /dev/rhdisk56        [17, 56]
DWHICTpDSK12    /dev/rhdisk57        [17, 58]
DWHICTpDSK13    /dev/rhdisk63        [17, 63]
DWHICTpDSK14    /dev/rhdisk64        [17, 64]
DWHICTpDSK15    /dev/rhdisk116       [17,117]

The two numbers in parentheses are major and minor number respectively.

I checked this script on IBM AIX platform

Nessun commento: