1751966 Members
4758 Online
108783 Solutions
New Discussion юеВ

Re: startup script

 
sh5490
Frequent Advisor

Re: startup script

hi yogreej,

kindly find contents of dbora script

ORACLE_HOME=/u01/app/oracle/OraHome_1;export ORACLE_HOME
#;export ORACLE_HOME
ORACLE_SID=ciehoi;export ORACLE_SID
# oracle owner at your site.
ORACLE=oracle
PATH=${PATH}:$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
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "starting Oracle Net Listener"
su - $ORACLE -c "lsnrctl start" >> $LOG2>&1 &
fi
echo "Starting Oracle databases"
su - $ORACLE -c "dbstart" >> $LOG2>&1 &
;;
'stop')
echo "$0: shutting down" >> $LOG
date >> $LOG
# Stop Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "stopping Oracle Net Listener">> $LOG2>&1&
su - $ORACLE -c "lsnrctl stop" >> $LOG2>&1 &
fi
echo "stopping Oracle databases">>$LOG2>&1&
su - $ORACLE -c "dbshut" >> $LOG2>&1 &
;;
*)
echo "usage: $0 {start|stop}"
exit
;;

thanks

shabir

Yogeeraj_1
Honored Contributor

Re: startup script

Hi shabir,

This script is not according to standards. Please modify the script such that it looks something similar to /sbin/init.d/syslogd

i.e.
#!/sbin/sh
...
rval=0
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1
fi
}
...

exit $rval


Please let us know if this works!

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,

it didn't work
for u info,rc.log contents



usage: /sbin/rc2.d/S99dbora {start|stop}
Output from "/sbin/rc2.d/S99dbora start":
----------------------------
/sbin/rc2.d/S99dbora[11]: exit0: not found.
/sbin/rc2.d/S99dbora[18]: hostname: not found.
/sbin/rc2.d/S99dbora[23]: touch: not found.
starting Oracle Net Listener
/sbin/rc2.d/S99dbora[34]: su: not found.
Starting Oracle databases
/sbin/rc2.d/S99dbora[37]: su: not found.

usage: /sbin/rc2.d/S99dbora.org {start|stop}
Output from "/sbin/rc2.d/S99dbora.org start":
----------------------------
/sbin/rc2.d/S99dbora.org[7]: hostname: not found.
/sbin/rc2.d/S99dbora.org[12]: touch: not found.
starting Oracle Net Listener
Starting Oracle databases

thanks
shabir
Yogeeraj_1
Honored Contributor

Re: startup script

hi again,

can you please post your "new" dbora script?

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
MarkSyder
Honored Contributor

Re: startup script

This line seems to be part of your problem:

PATH=${PATH}:$ORACLE_HOME/bin

This is the first time PATH is declared. You need to incorporate the path of the commands su, hostname, etc.

Mark
The triumph of evil requires only that good men do nothing
Fabien GUTIERREZ
Frequent Advisor

Re: startup script

init scripts on hp-ux must follow some rules
let s see behind what to use

#!/sbin/sh
PATH=/usr/sbin:/usr/bin:/sbin
export PATH

case $1 in
'start_msg')
echo "a string"
;;

'stop_msg')
echo "a string"
;;

'start')
/sbin/init.d/yourscript start
;;
'stop')
/sbin/init.d/yourscript stop
;;
'status')
/sbin/init.d/yourscript status
;;
*)
echo "Utilisation $0 start|stop|status"
exit 1
;;
esac
exit 0
sh5490
Frequent Advisor

Re: startup script

hi yogreej,

pls find new dbor script contents

# directory for you installation
ORACLE_HOME=/u01/app/oracle/OraHome_1;export ORACLE_HOME
rval=0
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1
fi
}
exit$rval

#;export ORACLE_HOME
ORACLE_SID=ciehoi;export ORACLE_SID
# oracle owner at your site.
ORACLE=oracle
PATH=${PATH}:$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
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "starting Oracle Net Listener"
su - $ORACLE -c "lsnrctl start" >> $LOG2>&1 &
fi
echo "Starting Oracle databases"
su - $ORACLE -c "dbstart" >> $LOG2>&1 &
;;
'stop')
echo "$0: shutting down" >> $LOG
date >> $LOG
# Stop Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "stopping Oracle Net Listener">> $LOG2>&1&
su - $ORACLE -c "lsnrctl stop" >> $LOG2>&1 &
fi
echo "stopping Oracle databases">>$LOG2>&1&
su - $ORACLE -c "dbshut" >> $LOG2>&1 &
;;
*)
echo "usage: $0 {start|stop}"
exit
;;
esac
#
exit

thanks

shabir

Peter Nikitka
Honored Contributor

Re: startup script

Hi,

when you had read Fabian's carefully, you would have identified the problematic lines:
>>>
...
# oracle owner at your site.
ORACLE=oracle
PATH=${PATH}:$ORACLE_HOME/bin
...
<<<
Nothing of the variable PATH is set but you use it. Put at least this at the beginning of your startup script:
PATH=${PATH:-/usr/bin}

The logfile should contain much lesser 'not found's (if any).

The statement
exit$rval
is wrong - there needs to be a space between command and argument:
exit $rval

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,

based on the recommendations made by Fabian and Peter above. I have modified your dbora script and uploading it again.

can you please try this again?

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Yogeeraj_1
Honored Contributor

Re: startup script

your modified dbora script
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)