background image
<< Select the number for host | Invalid number >>
<< Select the number for host | Invalid number >>

Discover volumes

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
erm_setup.ksh
Remote Mirroring of an Oracle Database Using Data Replicator Software
B-11
#--------------------------
# Discover volumes
#--------------------------
echo "\n\nPlease wait, gathering list of currently configured
volumes on remote"
echo "host $RMT_HOST's array $RMT_ARRAY...\c"
rotate &
RPID=$!
/usr/sbin/SMcli -n "$RMT_ARRAY" -c "show allVolumes;" -o
${TMP_FILE[3]} -S
kill -9 $RPID
VOL_NUM_TMP=`grep -c '(P)' ${TMP_FILE[3]}`
STATUS=1
while (( STATUS != 0 )); do
echo "\n\nThe current number of defined mirror(s) on
$B3$RMT_ARRAY$EB are: $VOL_NUM_TMP"
echo "\nEnter number of mirror(s) that will be controlled
via erm.ksh script. [$VOL_NUM_TMP]\b\b\c"
read MIRROR_NUM
if [[ ! -n $MIRROR_NUM || $MIRROR_NUM -eq 0 ]]; then
MIRROR_NUM=$VOL_NUM_TMP
fi
while (( $MIRROR_NUM > 64 || $MIRROR_NUM < 1 )); do
echo "\n${B1}ERROR!${EB}"
echo "\tThe number of mirrors must be between 1
and 64."
echo "\nPlease reenter number of mirror volumes
to be processed: [ ]\b\b\b\c"
read MIRROR_NUM
if [[ ! -n $MIRROR_NUM || $MIRROR_NUM -eq 0 ]]; then
MIRROR_NUM=$VOL_NUM_TMP
fi
done
echo "The number of mirrors to be processed =
$B2$MIRROR_NUM$EB"
prompt_usr
STATUS=$?
done
#----------------------------
# Get remote mirror volumes
#----------------------------
echo "\n\n${B1}REMOTE MIRROR INFORMATION:${EB}\n"
COUNTER=0
for X in `grep '(P)' ${TMP_FILE[3]} |awk '{print $1}'`; do
MIRROR_TMP[$COUNTER]=$X