Check permissions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
./goodies/move_ora_admin_files.ksh
Remote Mirroring of an Oracle Database Using Data Replicator Software
B-57
ANS=N
echo "\n${B3}ARE YOU SURE THIS PATH:${B0} $MIRROR_PATH ${EB}"
echo "will reside on a logical drive that will be mirrored"
echo "to the remote facilities? (Y or N) [ ]\b\b\c"
read ANS
if [[ $ANS != 'Y' ]]; then
echo "\nAborting script, no files or directories processed.
${B1}STATUS=5${EB}\n"
exit 5
fi
if [[ ! -d $MIRROR_PATH ]]; then
echo "\n$MIRROR_PATH does not exist."
echo "Create directory? (Y or N) [ ]\b\b\c"
read ANS
if [[ $ANS != 'Y' ]]; then
echo "\nAborting script, no files or directories
processed. ${B1}STATUS=5${EB}\n"
exit 5
else
mkdir -p $MIRROR_PATH > /dev/null 2>&1
fi
fi
mkdir -p $MIRROR_PATH/admin > /dev/null 2>&1
if [[ -L $ORALCE_HOME/admin/$ORACLE_SID ]]; then
echo "\n${B1}ERROR: $ORACLE_HOME/admin/$ORACLE_SID is already
linked.${EB}"
echo "\n${B3}$(ls -l $ORACLE_HOME/admin/$ORACLE_SID | awk -F'
' '{print $9" "$10" "$11}')${EB}\n"
echo "You can not use this script to configure the ERM
solution,"
echo "you must manually move the files and directory
sturctures"
echo "to the proper locations as described in the ERM
Installation"
echo "and Configuration Guidebook. ${B1}STATUS=3${EB}\n"
exit 3
else
echo "\nMoving $ORACLE_HOME/admin/$ORACLE_SID...\c"
mv $ORACLE_HOME/admin/$ORACLE_SID $MIRROR_PATH/admin > /dev/
null 2>&1
STATUS=$?
if (( STATUS > 0 )); then
echo "${B1}ERROR${EB}\n"
echo "Could not move $ORACLE_HOME/admin/$ORACLE_SID to"
echo "$MIRROR_PATH/admin. ${B1}STATUS=$STATUS${EB}"