Forum Stats

  • 3,741,767 Users
  • 2,248,474 Discussions
  • 7,861,979 Comments

Discussions

Script /etc/init.d/oracle-xe won't start database in manual mode

When you don´t want the Oracle XE database to do an automatic startup on linux, the file /etc/sysconfig/oracle-xe-config contains the following line:

ORACLE_DBENABLED=false

However, in the /etc/init.d/oracle-xe script, there is a verification of this value before the initialization of the listener and the database. Because it is false, the routine leaves, and nothing happens.

The listener and the database can be started manually with lsnrctl and sqlplus, but the script will not work. The code of the script is:

start() {

if test ! -f /etc/sysconfig/oracle-xe-config
then
echo You need to configure Oracle Database 10g Express Edition before\
you can start it.
exit 0
elif [ "$CONFIGURE_RUN" != "true" ]
then
echo You need to configure Oracle Database 10g Express Edition before\
you can start it.
exit 0
fi
------------------------------------------------------
This code will make the script to stop

if [ "$ORACLE_DBENABLED" != "true" ]
then
exit 0
fi
------------------------------------------------------
status=`ps -ef | grep tns | grep oraclexe`
if [ "$status" == "" ]
then
if [ -f $ORACLE_HOME/bin/tnslsnr ]
then
echo "Starting Oracle Net Listener."
$SU $ORACLE_OWNER -c "$LSNR start" > /dev/null 2>&1
fi
fi
echo "Starting Oracle Database 10g Express Edition Instance."
$SU $ORACLE_OWNER -c "$SQLPLUS -s /nolog @$ORACLE_HOME/config/scripts/startdb.sql" > /dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]
then
echo
else
echo Failed to start Oracle Net Listener using $ORACLE_HOME/bin/tnslsnr\
and Oracle Express Database using $ORACLE_HOME/bin/sqlplus.
RETVAL=1
fi
return $RETVAL
}
This discussion has been closed.