Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: startup/shutdown scripts
Hi Tony.
Under DEC UNIX 4b I suffered a similar fate with my Oracle startup/shutdown scripts. I eventually found it was a problem with the 'rsh' command. I've included my complete script. You probably don't need it all but I hope it helps you.
Regards,
Chris :)
<--start of script-->
#!/bin/sh
# Automates Oracle Server startup and shutdown.
# Note the use of su rather than rsh as suggested
# by Oracle. It appears that rsh doesn't work
# under DEC UNIX 4 for unknown reason. In turn
# note the use of the -c option on the su command
# to execute a command as the oracle user.
# Chris Muir 12/12/97
ORACLE_HOME=/u01/app/oracle/product/8.0.4
PATH=${PATH}:$ORACLE_HOME/bin
HOST=Bobafett
ORACLE=oracle
export ORACLE_HOME PATH
if [ ! "$2" = "ORA_DB" ] ; then
# rsh $HOST -l $ORACLE /sbin/init.d/oracle $1 ORA_DB
su - oracle -c "/sbin/init.d/oracle $1 ORA_DB" exit
# LOG=$ORACLE_HOME
LOG=$ORACLE_BASE/admin/AGWA/logbook/dbstartup.log
touch $LOG
chmod a+r $LOG
case $1 in
'start')
echo "$0: starting up" >> $LOG date >> $LOG # Start SQL*NET V2 if [ -f $ORACLE_HOME/bin/tnslsnr ] ; then echo "" >> $LOG 2>&1 echo "Starting Oracle Listener" $ORACLE_HOME/bin/lsnrctl start >> $LOG 2>&1 echo "Starting Oracle SNMP Listener" $ORACLE_HOME/bin/lsnrctl dbsnmp_start >> $LOG 2>&1 fi echo "Starting Oracle Server" $ORACLE_HOME/bin/dbstart >> $LOG 2>&1 ;; 'stop') echo "$0: shutting down" >> $LOG date >> $LOG # Stop SQL*NET V2 if [ -f $ORACLE_HOME/bin/tnslsnr ] ; then echo "" >> $LOG 2>&1 echo "Stopping Oracle SNMP Listener (then sleeping 2 seconds to allow execution to complete)" $ORACLE_HOME/bin/lsnrctl dbsnmp_stop >> $LOG 2>&1 sleep 2 echo "Stopping Oracle Listener" $ORACLE_HOME/bin/lsnrctl stop >> $LOG 2>&1 fi echo "Stopping Oracle Server" $ORACLE_HOME/bin/dbshut >> $LOG 2>&1 ;; *) echo "usage: $0 {start|stop}" exit ;;
exit
<--end of script-->
On Wed, 05 Aug 1998 14:06:31 GMT, "Tony Thell" <tony969_at_visi.com> wrote:
>Here's my problem: > >I am running Oracle 7.3.3 on Solaris 2.5.1 and when I either start or >shutdown the box the "automatic" Oracle startup/shutdown scripts don't want >to work. I've looked at all the scripts involved, but nothing that could be >wrong really jumps out at me. > >To confuse me even more, I have another SUN box running Solaris 2.5 and >Oracle 7.3.2 and 7.3.4 and as far as I can tell, all of those instances seem >to start and stop when I start or shutdown the box. I've tried copying the >scripts in question from the "working" 2.5 box to the "non-working" 2.5.1 >box but it doesn't solve the problem. > >Anyway, I was wondering if anyone has come across any startup/shutdown >scripts, in a book or on-line, that I could take a look at and/or use as an >alternative to what I have. I must state that I am not an Oracle DBA but >rather a Solaris sysadmin who got stuck with this problem and is getting a >headache trying to solve it. > >Thanks for your time and effort, >Tony >Received on Wed Aug 05 1998 - 20:45:40 CDT
![]() |
![]() |