background image
<< ORACLE_SID.ora | Suspend the Database >>
<< ORACLE_SID.ora | Suspend the Database >>

C. Oracle on the Sun Solaris OS Scripts

Remote Mirroring of an Oracle Database Using Data Replicator Software
C-1
Appendix
C
Oracle on the Sun Solaris OS Scripts
This chapter shows the Oracle on the Sun Solaris OS scripts that facilitate the mirroring of
an Oracle database. The sample scripts are intended for instructional purposes only. When
you are actually implementing scripts, always download the most recent compressed file
and use the latest scripts available.
Stop the Database on the Remote Site
#!/bin/ksh
#-----------------------------------------------------------
# shutdown Oracle database
#-----------------------------------------------------------
PRI_DB_ID=$1
ORACLE_SID=$2
ORACLE_HOME=$3
ORA_DUMP=$4
LOG=$5
TRACE=$6
RMT_SCRIPT_DIR=$7
ORACLE_BASE=$8
export PRI_DB_ID
export ORACLE_SID
export ORACLE_HOME
export ORA_DUMP
export LOG
export TRACE
export RMT_SCRIPT_DIR
export ORACLE_BASE
############################################################
# shutdown database if it is online #
############################################################
${RMT_SCRIPT_DIR}/.remote/oracle/db_online ${PRI_DB_ID}
${ORACLE_SID} ${TRACE} >> $TRACE
if [ $? = 0 ]
then
su - ${PRI_DB_ID} -c "${RMT_SCRIPT_DIR}/.remote/oracle/
db_shutdown ${ORACLE_SID} ${ORACLE_HOME} ${TRACE}" >> $TRACE
fi