Monday, September 28, 2009

Auto start listener

#
# Set ORACLE_HOME_LISTNER
# Set this to enable auto startup for Oracle Net Listener.
# The script uses this find the binary to start Net Listener.
#
# Also, if the listener name is not the default name LISTENER, you must
# specify the listener name in the stop and start commands:
# $ORACLE_HOME/bin/lsnrctl {startstop} listener_name
#
#####################################

# Set this to bring up Oracle Net Listener
ORA_HOME="/d02/oracle/ora102"
ORA_OWNER="oracle"

if [ ! $ORA_HOME ] ; then
echo "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener"
else
LOG=/var/oracle/ora102/network/log/listener.log

# Start Oracle Net Listener
if [ -f $ORA_HOME/bin/tnslsnr ] ; then
echo "Starting Oracle Net Listener"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
else
echo "Oracle Net Listener already started"
fi
fi

No comments: