Disable Snapshots
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
erm.ksh
Remote Mirroring of an Oracle Database Using Data Replicator Software
B-31
display "Running fsck on '/dev/${VOL_LV[$1]}'"
echo "# fsck -y /dev/${VOL_LV[$1]}" >> $TRACE
fsck -y /dev/${VOL_LV[$1]} >> $TRACE 2>&1
Kill_WAIT 0
display "Remounting ${VOL_MNT[$1]}..."
echo "# mount /dev/${VOL_LV[$1]} ${VOL_MNT[$1]}" >> $TRACE
mount /dev/${VOL_LV[$1]} ${VOL_MNT[$1]} >> $TRACE 2>&1
STATUS=$?
fi
if (( STATUS > 0 )); then
Kill_WAIT 1
echo "\t${B1}ERROR: XX${EB} Unable to mount
${VOL_MNT[$1]} - STATUS = $STATUS"
echo `date +%T`" ERROR: XX - Unable to mount /
dev/${VOL_LV[$1]}, errorcode $STATUS" >> $LOG
return 1
else
echo `date +%T`" SUCCESS - Volume ${VOL_HD[$1]}
mounted on ${VOL_MNT[$1]}." >> $LOG
Kill_WAIT 0
return 0
fi
}
disable ()
{
#-------------------------------------------------------------
# FUNCTION used to disable Snapshots
#-------------------------------------------------------------
# Args:
# $1 = Index number of volume to process
if [[ $DEBUG -eq 1 ]]; then
set -x
fi
display "Deactivating ${VOL_MNT[$1]}"
echo "# SMcli -n \"$RMT_ARRAY\" -S -c \"disableSnapshot
volume [\"${VOL_SP[$1]}\"];\"" >> $TRACE
SMcli -n "$RMT_ARRAY" -S -c "disableSnapshot volume
[\"${VOL_SP[$1]}\"];" >> $TRACE 2>&1
STATUS=$?
if (( STATUS != 0 )); then
echo `date +%T`" ERROR: 34 - Unable to deactivate
${VOL_MNT[$1]} Snapshot, errorcode $STATUS ***" >> $LOG
Kill_WAIT 1
echo "\t${B1}ERROR: 34${EB} - Unable to deactivate
${VOL_MNT[$1]}, STATUS=$STATUS."