Restart local database
Oracle on the AIX OS Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-46
Remote Mirroring of an Oracle Database Using Data Replicator Software
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
}
#----------------------------
# End of defined functions
#----------------------------
umask 000
echo "#--------------------------------------------------------
---------------------" >> $TRACE
echo "# Start of $SCRIPT_DIR/db_start @ `date +%T`" >> $TRACE
echo "#--------------------------------------------------------
---------------------" >> $TRACE
umask 022
#--------------------------
# Check database status
#--------------------------
db_status
STATUS=$?
if (( $STATUS > 0 )); then
echo "INFO: $ORA_SID instance is already running -- aborting
startup" >> $TRACE
echo "#-----------------------------------------------------
------------------------" >> $TRACE
echo "# End of $SCRIPT_DIR/db_start @ `date +%T`" >> $TRACE
echo "#\t\tEXIT STATUS = $STATUS" >> $TRACE
echo "#-----------------------------------------------------
------------------------" >> $TRACE
exit 1
fi
#-------------------------------------------------------------
# set up soft links for Oracle dump areas and configuration files
#-------------------------------------------------------------
db_create_softlinks
#--------------------------------------------------------
# Start local Oracle database with backup controlfile
#--------------------------------------------------------
#echo "# su - $PRI_DB_ID \"-c sqlplus -s / as sysdba @
$SCRIPT_DIR/db_start.sql\"" >> $TRACE
echo "# su - $PRI_DB_ID -c sqlplus -s / as sysdba @ $ORA_DUMP/
remote_startup.sql" >> $TRACE