Create Volume Copy
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .The
sun_erm.ksh
Script
Remote Mirroring of an Oracle Database Using Data Replicator Software
C-19
# Args:
# $1 = Index number of volume to process
if [[ $VERIFY -eq 1 ]]; then
set -n
elif [[ $DEBUG -eq 1 && $VERIFY -eq 0 ]]; then
set -x
fi
display "Establishing Volume Copy of ${VOL_MNT[$1]}"
# Write command to $TRACE file for debugging
echo "# SMcli -n \"$RMT_SUBSYSTEM\" -S -c \"show LogicalDriveCopy
target [\"${VOL_VC[$1]}\"];\" -o $RMT_LOG_DIR/
${VOL_VC[$1]}.vc_status" >> $TRACE
SMcli -n "$RMT_SUBSYSTEM" -S -c "show LogicalDriveCopy
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 >.<)
# Write command to $TRACE file for debugging
echo "# SMcli -n \"$RMT_SUBSYSTEM\" -S -c \"recopy
logicalDriveCopy target [\"${VOL_VC[$1]}\"] source
[\"${VOL_FC[$1]}\"] copyPriority=$VC_PRIORITY
targetReadOnlyEnabled=FALSE;\" -o $RMT_LOG_DIR/
${VOL_VC[$1]}_est.log" >> $TRACE
SMcli -n "$RMT_SUBSYSTEM" -S -c "recopy
logicalDriveCopy target [\"${VOL_VC[$1]}\"] source
[\"${VOL_FC[$1]}\"] \
copyPriority=$VC_PRIORITY
targetReadOnlyEnabled=FALSE;" -o $RMT_LOG_DIR/
${VOL_VC[$1]}_est.log 2>>$TRACE
STATUS=$?
else
# Write command to $TRACE file for debugging
echo "# SMcli -n \"$RMT_SUBSYSTEM\" -S -c \"create
LogicalDriveCopy source=\"${VOL_FC[$1]}\"
target=\"${VOL_VC[$1]}\" copyPriority=$VC_PRIORITY
targetReadOnlyEnabled=FALSE;\" -o $RMT_LOG_DIR/
${VOL_VC[$1]}_est.log" >> $TRACE
# Create Volume Copy if not a target already