1828174 Members
2545 Online
109975 Solutions
New Discussion

Re: startup script

 
Peter Nikitka
Honored Contributor

Re: startup script

Hi,

have you an answer to my last questions?
What do you find in the mentioned lines in db* ?

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Peter Nikitka
Honored Contributor

Re: startup script

Hi,

to relax between the heavy testing, here is some additional material to read (How to submit points):

http://forums12.itrc.hp.com/service/forums/helptips.do?#33

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Yogeeraj_1
Honored Contributor

Re: startup script

Hi,

as requested by Peter above, please post the lines from the two scripts.
line 89 -> dbstart
line 78 -> dbshut


revert!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
sh5490
Frequent Advisor

Re: startup script

hi all,

pls find the line Nob's mentioned by peter in dbstart & dbshut script

dbstart script
89 if [ ! $ORACLE_HOME_LISTNER ] ; then
90 echo "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net
Listener"

dbshut script
78 if [ ! $ORACLE_HOME_LISTNER ] ; then
79 echo "ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net L
istener"

THANKS
SHABIR
Peter Nikitka
Honored Contributor

Re: startup script

Hi shabir,

as you see, there are unquoted variables in a test statement: This leads to a syntax error, when the variable is empty or unset. I already told you what to do.
You could have tested such a change already - be more proactive!

The other question is, WHY this variable is empty. Perhaps your entries in /etc/oratab are not of a kind, Oracle expects?

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
sh5490
Frequent Advisor

Re: startup script

hi peter,
thanks for you inputs,

we the following entry in /etc/oratab
cieho:/u01/app/oracle/OraHome_1:Y

thanks

shabir
Yogeeraj_1
Honored Contributor

Re: startup script

hi Shabir,

Also post the lines 88 (dbstart) and 77 (dbshut)

Both line should look as follows:
ORACLE_HOME_LISTNER=$1


revert!
kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
sh5490
Frequent Advisor

Re: startup script

hi yogreej,

can you pls confirm which run level is valid for executing dbora & dbshut script

In your previous update u have mentioned rc2.d

thanks
shabir
Peter Nikitka
Honored Contributor

Re: startup script

Hi,

it's common practise to start DBs at runlevel 2.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Yogeeraj_1
Honored Contributor

Re: startup script

hi Shabir,

As mentioned by Peter above, it should be run-level 2. Note that in Redhat Linux, it should be run-level 3.

Are you making any further changes?

please also let us know about the current status.

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
sh5490
Frequent Advisor

Re: startup script

hi yogreej,

This script works fine but we have hardcoded the run level path.

Still i am not able to understand why this not executing under runlevel 2

thanks

shabir



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
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
#set -x
ORACLE_SID=cieho;export ORACLE_SID
# oracle owner at your site.
ORACLE=oracle
# CHANGED: PATH=${PATH}:$ORACLE_HOME/bin
ORACLE_HOME=/u01/app/oracle/OraHome_1;export ORACLE_HOME
ORACLE_HOME_LISTNER=/u01/app/oracle/OraHome_1;export ORACLE_HOME_LISTNER
#PATH=${PATH:-/usr/bin}:$ORACLE_HOME/bin
PATH=/usr/sbin:/bin:/usr/bin:/sbin:${PATH}:$ORACLE_HOME/bin
export PATH
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
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 "dbstart $ORACLE_HOME" >> $LOG 2>&1

;;
'stop')
echo "$0: shutting down" >> $LOG
date >> $LOG
# Stop Oracle Net
#set -x
ORACLE_SID=cieho;export ORACLE_SID
# oracle owner at your site.
ORACLE=oracle
# CHANGED: PATH=${PATH}:$ORACLE_HOME/bin
ORACLE_HOME=/u01/app/oracle/OraHome_1;export ORACLE_HOME
ORACLE_HOME_LISTNER=/u01/app/oracle/OraHome_1;export ORACLE_HOME_LISTNER
#PATH=${PATH:-/usr/bin}:$ORACLE_HOME/bin
PATH=/usr/sbin:/bin:/usr/bin:/sbin:${PATH}:$ORACLE_HOME/bin
export PATH
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
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 "dbstart $ORACLE_HOME" >> $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 "dbshut $ORACLE_HOME" >> $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}


Yogeeraj_1
Honored Contributor

Re: startup script

> This script works fine but we have hardcoded the run level path.
Please clarify.


>Still i am not able to understand why this not executing under runlevel 2
please upload your /etc/rc.log for us to be able to investigate further

No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Peter Nikitka
Honored Contributor

Re: startup script

Hi,

if your rc-scripts is in such a disorder as posted, I don't wonder, that it does not work.
If it's a corrupted posting, please retry.

If not, especially the PATH declerations must be moved to the top lines in the script before execution any commands.
I would merge the two start/stop sections into one to see clearer what is done in a start or a stop switch.

mfG Peter

PS: Still no time to submit points? We take time to answer questions ;-)
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
sh5490
Frequent Advisor

Re: startup script

hi,

kindly find the rc.log


thanks

shabir
Tim Nelson
Honored Contributor

Re: startup script

Wow. This just might be a record thread.

63 entries

0 points

Peter Nikitka
Honored Contributor

Re: startup script

Hi,

did you find any relevant output of S900dbora?
I did not - what should us be told?
Perhaps it's best to use am extra logfile for the error output of this script. Add at the beginning of the rc-script something like that:

exec 2>/tmp/dbora.stderr
set -x

Post the rc-script and the above logfile.

Next: you still did not answer my question about the rc-script.

mfG Peter

PS: Tim posted two numbers - don't mind, we do not give up soon, so the first number may grow. You are really the only one who can change the second number as well!!
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Laurent Menase
Honored Contributor

Re: startup script

Hi,

I suppose that the application started is using sockets.
socket MUST NOT be used before rc3 S008net.init
else you may get a useless socket and the process may hang in some conditions.

So on hpux always start application using sockets after rc3.d/S008net.init