Check status of database
Oracle on the AIX OS Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-42
Remote Mirroring of an Oracle Database Using Data Replicator Software
echo "\t<CFG_FILE> = full path and name of .conf file to read-
in variables"
echo "\t<TIME_STAMP> = suffix to append to trace file"
exit 1
fi
# Source config file for variables
CFG_FILE=$1
. $CFG_FILE
TRACE=$RMT_LOG_DIR/${RMT_HOST}_${ORA_SID}_trace.$2
SCRIPT_DIR=$RMT_SCRIPT_DIR/.remote/oracle
ADMIN_DIR=$ORA_HOME/admin/$ORA_SID
#--------------------------
# Defined functions
#--------------------------
db_status ()
{
STATUS=$(ps -afe |grep -w $PRI_DB_ID | grep -c
ora_pmon_${ORA_SID})
echo "STATUS: $STATUS ( 1=online, 0=offline )" >> $TRACE
return $STATUS
}
db_remove_softlinks ()
{
if [[ -L $ADMIN_DIR ]]; then
echo "# rm $ADMIN_DIR" >> $TRACE
rm $ADMIN_DIR >> $TRACE 2>&1
else
echo "INFO: No $ADMIN_DIR link to remove." >> $TRACE
fi
if [[ -L $ORA_HOME/dbs/init${ORA_SID}.ora ]]; then
echo "# rm $ORA_HOME/dbs/init${ORA_SID}.ora" >> $TRACE
rm $ORA_HOME/dbs/init${ORA_SID}.ora >> $TRACE 2>&1
else
echo "INFO: No $ORA_HOME/dbs/init${ORA_SID}.ora link to
remove." >> $TRACE
fi
if [[ -L $ORA_HOME/dbs/spfile${ORA_SID}.ora ]]; then
echo "# rm $ORA_HOME/dbs/spfile${ORA_SID}.ora" >> $TRACE
rm $ORA_HOME/dbs/spfile${ORA_SID}.ora >> $TRACE 2>&1
else
echo "INFO: No $ORA_HOME/dbs/spfile${ORA_SID}.ora link to
remove." >> $TRACE
fi
}