cancel
Showing results for 
Search instead for 
Did you mean: 

auto startup listener fails

 
shabir_1
Occasional Advisor

auto startup listener fails

Hi,
we are using dbora script for startup & shutdown od oracle database & listeners
which is running scessfully.

We try implement same script for another server.
it start and stops dabase manaully & on run level
But fails listner startup

any input to resolve this issue

atcched dbscript for you review

10 REPLIES
Horia Chirculescu
Honored Contributor

Re: auto startup listener fails

>atcched dbscript for you review

You omitted the script...

Horia.
Best regards from Romania,
Horia.
Horia Chirculescu
Honored Contributor

Re: auto startup listener fails

>But fails listner startup

Should look for any error code/message provided.

Read the logs.

Horia
Best regards from Romania,
Horia.
Michal Kapalka (mikap)
Honored Contributor

Re: auto startup listener fails

hi,

could you please send how do you try to start the oracle listener ??

are you running only one listener on the DB server or you have more instances and listeners ???


mikap
shabir_1
Occasional Advisor

Re: auto startup listener fails

we are using ./bash shell


set -x
ORACLE_SID=cieho;export ORACLE_SID
# oracle owner at your site.
ORACLE=oracle
# CHANGED: PATH=${PATH}:$ORACLE_HOME/bin
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export ORACLE_HOME_LISTNER=$ORACLE_HOME
export PATH=${PATH}:/usr/sbin:/bin:/usr/bin:/sbin:$ORACLE_HOME/bin
HOST=`hostname`
PLATFORM=`uname`
#export ORACLE_HOME PATH
#
LOG=$ORACLE_HOME/stop1.log
touch $LOG
chmod a+r $LOG
#
case $1 in
'start')
echo "$0: starting up" >> $LOG
date >> $LOG
# Start Oracle Net
echo $ORACLE_HOME
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;

then
echo "starting Oracle Net Listener" >> $LOG 2>&1
su - $ORACLE -c "lsnrctl start" >> $LOG 2>&1
fi
echo "Starting Oracle databases" >> $LOG 2>&1
echo $ORACLE $PATH "dbstart $ORACLE_HOME" >> $LOG 2>&1

which su >> $LOG 2>&1
su - $ORACLE -c "$ORACLE_HOME/bin/dbstart" >> $LOG 2>&1
;;
'stop')
echo "$0: shutting down" >> $LOG
date >> $LOG
# Stop Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "stopping Oracle Net Listener">> $LOG 2>&1
su - $ORACLE -c "lsnrctl stop" >> $LOG 2>&1
fi
echo "stopping Oracle databases">>$LOG 2>&1
su - $ORACLE -c "$ORACLE_HOME/bin/dbshut" >> $LOG 2>&1
;;
# YOU NEED THIS AS WELL, as rc will supply this parameters:
*start_msg) echo "starting oracle " ;;
*stop_msg) echo "stopping oracle " ;;
*)
echo "usage: $0 {start[_msg]|stop[_msg}"
# SUPPLY AN EXIT CODE FOR exit
retcode=1
;;

# MISSING ESAC
esac
# USUALLY you work with a variable retcode (e.g.) in rc scripts
exit ${retcode:-0}
Michal Kapalka (mikap)
Honored Contributor

Re: auto startup listener fails

hi,

i have a one question, if you start the listener and DB instance manually, is it working ??

this script that you are using is very common, but the question is if the listener config is correct.

mikap
Horia Chirculescu
Honored Contributor

Re: auto startup listener fails

LOG=$ORACLE_HOME/stop1.log
...
su - $ORACLE -c "lsnrctl start" >> $LOG 2>&1

So how does it look like $ORACLE_HOME/stop1.log file? Any messages about listner?

Horia.

Best regards from Romania,
Horia.
shabir_1
Occasional Advisor

Re: auto startup listener fails

Hi Horia,

Following meesage is seen in stop1.log
./dbora: shutting down
Mon Mar 22 12:45:49 IST 2010
stopping Oracle Net Listener
-bash: lsnrctl: command not found
stopping Oracle databases

thanks
(Shabir)
Johnson Punniyalingam
Honored Contributor

Re: auto startup listener fails

>>>-bash: lsnrctl: command not found

pls try to incorporate $PATH for "lsnrct" in your script .


if you are able to start listener manually as per below, suspecting could be absolute path problem for "lsnrctl" in your script

su - $ORACLE -c "lsnrctl start"
Problems are common to all, but attitude makes the difference
Michal Kapalka (mikap)
Honored Contributor

Re: auto startup listener fails

hi,

set this variables :

ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/app/10.2.0; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLA
SSPATH

for example

mikap
Horia Chirculescu
Honored Contributor

Re: auto startup listener fails

Hello,

>-bash: lsnrctl: command not found

I believe that you missed something:

You are calling su with -. This means that the shell (bash in your case) will source the profile for your user $ORACLE.

So, your definitions of the env. variables will be lost and replaced by the user (from profile) defined variables (if any).

Please check

~/$ORACLE/.bash_profile

or

~/$ORACLE/.profile

You must edit this file and define all the ORACLE related variables here. You should use ~/$ORACLE/.profile because it is common to BASH and POSIX shell.

Best regards from Romania,
Horia.
Best regards from Romania,
Horia.