SUMMARY: Shutting down DU with Oracle wrt rc?.d scripts

From: Karen Thomas <kthomas_at_csunet.ctstateu.edu>
Date: Wed, 9 Apr 1997 10:28:27 -0400 (EDT)

Managers,

        Summary is two fold. Original question is at the bottom.

1> Do not use shutdown command use the init command instead. The shutdown
command will not stop the processes in the /sbin/rc?.d directories it will
not wait for them to finish it will just halt the processor. Do a man on
init to find the correct method. Thanks to Brenden Phillips and Matthew
Calthrop for the note about that:

Mathew's note:
        Another point to note: the "shutdown" program does not actually wait for
        the kill scripts (/sbin/rc*.d/K*) to finish before shutting down. It is
        generally a better policy to use "init 0", which does wait.

--------------------------------------------------------------------------
2> In the Oracle Installation book there is a script you can copy
and put into /sbin/init.d/oracle this script will be called from
/sbin/rc0.d to shutdown the databases and /sbin/rc3.d to start up the
databases and Oracle. Many people sent attachments and advice, I will
only include the ones that I used:

To create the /sbin/init.d/oracle script:
Matthew Calthrop <matthew.calthrop_at_reuters.com>:

#!/bin/sh
#
### 14/06/96 MJC Commented out start/stop of sql*net v1.
ORACLE_HOME=/oracle/product/v716
PATH=${PATH}:$ORACLE_HOME/bin
HOST=`hostname`

ORACLE=oracle
export ORACLE_HOME PATH

ORACLE=oracle

LOG=$ORACLE_HOME/startup.log
touch $LOG
chmod a+r $LOG
#
case $1 in
'start')
echo "$0: starting up..." >> $LOG
date >> $LOG
# Start sql*net v1
### 14/06/96 MJC - commented out, as we don't use it.
#if [ -f $ORACLE_HOME/bin/orasrv ] ;
#then
# echo "starting v1 listener..."
# su $ORACLE -c "$ORACLE_HOME/bin/tcpctl start forkon timeout 10" >> \
# $LOG 2 >&1
#fi
# Start sql*net v2
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
  echo "starting V2 listener..."
  su $ORACLE -c "$ORACLE_HOME/bin/lsnrctl start" >> \
  $LOG 2>&1
fi
echo "Starting Oracle databases..."
su $ORACLE -c "$ORACLE_HOME/bin/dbstart" >> $LOG 2>&1
;;
'stop')
echo "$0: shutting down..." >> $LOG
date >> $LOG
#Stop v1 listener
### 14/06/96 MJC - commented out, as we don't use it.
#if [ -f $ORACLE_HOME/bin/orasrv ] ;
#then
# echo "Stopping V1 listener..."
# su $ORACLE -c "$ORACLE_HOME/bin/tcpctl stop" >> $LOG 2>&1
#fi
#Stop V2 listener
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
  echo "Stopping V2 listener..."
  su $ORACLE -c "$ORACLE_HOME/bin/lsnrctl stop" >> $LOG 2>&1
fi
echo "Stopping Oracle databases"
su $ORACLE -c "$ORACLE_HOME/bin/dbshut" >> $LOG 2>&1
;;
*)
  echo "usage: $0: {start | stop}"
  exit
  ;;
esac
#
exit


To create the links:
Dejan Muhamedagic <muja_at_galeb.etf.bg.ac.yu>:

There should be an example S??oracle and K??oracle scripts: in fact it's
the same script accepting "start" and "stop" arguments. In general you
put a script (not a link) into /sbin/init.d (say /sbin/init.d/oracle),
then you make appropriate links in /sbin/rc0.d and /sbin/rc3.d (or
rc2.d) like this:
cd /sbin/rc0.d; ln -s ../init.d/oracle K00oracle
cd /sbin/rc3.d; ln -s ../init.d/oracle S99oracle
You have to check permissions for the script after you install it. In
general, the numbers should be low for K link and high for S link,
because you want to start it after everything and kill it first.

Original question:

=Managers,
= The other I shut our DU box down using shutdown -now with our new
=Oracle Database freshly installed. I asked our DBA what commands are
=needed to shut and restart oracle along with the system, so that it is
=included into the rcx.d directory. She told me to use the commands
dbshut
=and dbstart to start and stop Oracle.
=
= My question is what do I do with these scripts? Do I just put
=a symbolic link to these into the /sbin/rc3.d directory with a name like
=S62oracle and that would do it? Do I move the files right into the
=directory? Do I have to write some kind of other scrip to call these two
=scripts?
=
= I tried searching many sites and it seems like either it is a very
=easy or a very hard question to answer. I've seen answers like "these
=scripts should be incorporated into the rc?.d scripts" What does that
mean
=incorporated?
=
= To me it seems like a basic answer - but if it is much more
=complicated than that then could someone point me in a direction?

Thanks also to:

Ruben Zelwer <ruben_at_garnet.berkeley.edu>
Guy Dallaire <dallaire_at_total.net>
Casey Spangler <spang_at_probita.com>
Brenden Phillips <B.C.Phillips_at_massey.ac.nz>
"Nagaraja, Raja" <Raja.Nagaraja_at_actew.com.au>
Kurt Carlson <sxkac_at_java.sois.alaska.edu>
"Callahan, Drake" <CallahanD_at_Connext.com>
Kris Chandrasekhar <Chandrasekh_at_mail.dec.com>
James Anderson <anderson_at_ocaxp1.cc.oberlin.edu>
Randy Rodgers <rrodgers_at_fwi.com>
Dejan Muhamedagic <muja_at_galeb.etf.bg.ac.yu>
"Thomas.Meyer" <meyert_at_dla-marbach.de>
"Matthew Calthrop" <matthew.calthrop_at_reuters.com>


------------------------------------------------------------------------------
Karen Thomas

Connecticut State University System Office
Information System
THOMASK_at_CTSTATEU.EDU
PHONE: (860) 493-0118
Received on Wed Apr 09 1997 - 16:58:59 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:36 NZDT