background image
<< RVM Configuration Samples | Remove soft links for Oracle dump areas >>
<< RVM Configuration Samples | Remove soft links for Oracle dump areas >>

D. Oracle on the Linux OS Scripts

Remote Mirroring of an Oracle Database Using Data Replicator Software
D-1
Appendix
D
Oracle on the Linux OS Scripts
This appendix shows the Oracle on the Linux 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