Restart the Remote Database
Oracle on the Linux OS Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D-6
Remote Mirroring of an Oracle Database Using Data Replicator Software
Restart the Remote Database
#!/bin/ksh
PRI_DB_ID=$1
ORACLE_SID=$2
ORACLE_HOME=$3
ORA_DUMP=$4
LOG=$5
TRACE=$6
PRI_SCRIPT_DIR=$7
PRI_HOST=$8
export PRI_DB_ID
export ORACLE_SID
export ORACLE_HOME
export ORA_DUMP
export LOG
export TRACE
export PRI_SCRIPT_DIR
export PRI_HOST
###########################################################
# Take Oracle database out of backup mode on Primary host #
###########################################################
/usr/bin/rcp ${PRI_SCRIPT_DIR}/.primary/oracle/db_end_backup
$PRI_HOST:$PRI_SCRIPT_DIR/. >> ${TRACE}
/usr/bin/rsh $PRI_HOST chown $PRI_DB_ID $PRI_SCRIPT_DIR/
db_end_backup >> ${TRACE}
STATUS=`/usr/bin/rsh $PRI_HOST -l $PRI_DB_ID $PRI_SCRIPT_DIR/
db_end_backup ${ORACLE_SID} ${ORACLE_HOME}` >> ${TRACE}
if [ $STATUS != 0 ]
then
echo "ERROR!\n\tUnable to take primary database out of backup
mode" >> $LOG
exit 1
else
echo `date +%H":"%M":"%S`" SUCCESS - primary database out
of backup mode" >> $LOG
fi
#######################
# Archive log current #
#######################
/usr/bin/rcp ${PRI_SCRIPT_DIR}/.primary/oracle/
db_archive_log_current $PRI_HOST:$PRI_SCRIPT_DIR/. >> ${TRACE}
/usr/bin/rsh $PRI_HOST chown $PRI_DB_ID $PRI_SCRIPT_DIR/
db_archive_log_current >> ${TRACE}