asm disk 와 physical disk mapping 확인 Shell script


oracle asm 으로 구성했을 경우.

===========================================================

#!/bin/bash

## ASMLIB_DISK  -- disk name in ASMLIB

## ASM_DISK -- disk name in ASM

## DEVICE -- physical disk name

GRID_HOME=`cat /etc/oratab  | grep ^+ASM | awk -F":" '{print $2}'`

for ASMLIB_DISK in `ls /dev/oracleasm/disks/*`

  do

    ASM_DISK=`$GRID_HOME/bin/kfed read $ASMLIB_DISK | grep dskname | tr -s ' '| cut -f2 -d' '`

    majorminor=`ls -l $ASMLIB_DISK | tr -s ' ' | cut -f5,6 -d' '`

    device=`ls -l /dev/ | tr -s ' ' | grep -w "$majorminor" | cut -f10 -d' '`

    echo "ASMLIB disk name : $ASMLIB_DISK"

    echo "ASM_DISK name : $ASM_DISK"

    echo "Physical disk device : /dev/$device"

done

===========================================================


Posted by pat98

01-25 18:32
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

 « |  » 2025.1
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 달린 댓글