Establish Volume Copies
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
erm.ksh
Remote Mirroring of an Oracle Database Using Data Replicator Software
B-25
return 1
else
echo `date +%T`" SUCCESS - Snapshot of ${VOL_SP[$1]}
created." >> $LOG
Kill_WAIT 0
return 0
fi
}
establish ()
{
#-------------------------------------------------------------
# FUNCTION used to establish Volume Copies
#-------------------------------------------------------------
# Args:
# $1 = Index number of volume to process
if [[ $DEBUG -eq 1 ]]; then
set -x
fi
display "Establishing Volume Copy of ${VOL_MNT[$1]}"
echo "# SMcli -n \"$RMT_ARRAY\" -S -c \"show volumeCopy
target [\"${VOL_VC[$1]}\"];\" -o $RMT_LOG_DIR/
${VOL_VC[$1]}.vc_status" >> $TRACE
SMcli -n "$RMT_ARRAY" -S -c "show volumeCopy target
[\"${VOL_VC[$1]}\"];" \
-o $RMT_LOG_DIR/${VOL_VC[$1]}.vc_status 2>>$TRACE
if [[ $(grep -c 'Role: Target' $RMT_LOG_DIR/
${VOL_VC[$1]}.vc_status) -eq 1 ]]; then
# Recopy if already a Volume Copy target (Hopefully
the correct target >.<)
echo "# SMcli -n \"$RMT_ARRAY\" -S -c \"recopy volumeCopy
target [\"${VOL_VC[$1]}\"] source [\"${VOL_SP[$1]}\"]
copyPriority=$VC_PRIORITY targetReadOnlyEnabled=FALSE;\" -o
$RMT_LOG_DIR/${VOL_VC[$1]}_est.log" >> $TRACE
SMcli -n "$RMT_ARRAY" -S -c "recopy volumeCopy target
[\"${VOL_VC[$1]}\"] source [\"${VOL_SP[$1]}\"] \
copyPriority=$VC_PRIORITY targetReadOnlyEnabled=FALSE;" -
o $RMT_LOG_DIR/${VOL_VC[$1]}_est.log 2>>$TRACE
STATUS=$?
else
# Create Volume Copy if not a target already
echo "# SMcli -n \"$RMT_ARRAY\" -S -c \"create volumeCopy
source=\"${VOL_SP[$1]}\" target=\"${VOL_VC[$1]}\"
copyPriority=$VC_PRIORITY targetReadOnlyEnabled=FALSE;\" -o
$RMT_LOG_DIR/${VOL_VC[$1]}_est.log" >> $TRACE
SMcli -n "$RMT_ARRAY" -S -c "create volumeCopy
source=\"${VOL_SP[$1]}\" target=\"${VOL_VC[$1]}\" \