Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Still experiencing Auto-shtudown problem on RedHat 8.0

Re: Still experiencing Auto-shtudown problem on RedHat 8.0

From: Mark Nunes <markn_at_san.rr.com>
Date: Tue, 22 Oct 2002 02:46:46 GMT
Message-ID: <3DB4BBF2.1020004@san.rr.com>


Thanks Nelson. I do realize that su - gets a user's environment. In fact, in my script I set ORA_OWNER=oracle and then su - $ORA_OWNER. Oracle's .bash_profile is properly configured to set the ORACLE_SID, ORACLE_BASE and ORACLE_HOME. $ORACLE_HOME/bin is in my PATH.
$ORACLE_HOME/bin is where dbshut resides. dbshut is called by the stop
section of dbora. I should mention again that when I manually run dbora stop, the database does shutdown. So I know that the oracle user's environment is being used, or else it wouldn't know where to look for dbshut, and the db wouldn't shutdown. You mention that you stop Oracle from rc5.d as well. I'm a little shaky on the sysVinit stuff. Do links beginning with S get 'start' issued to their corresponding scipts when you switch to a particular run level(in your case, run level 5), and links beginning with a K get issued a 'stop' to their corresponding scripts when you exit that run level? I have pasted in my dbora script.   Perhaps you might see something that I'm missing.

/etc/init.d/dbora

#!/bin/sh
#
# description: starts the oracle dabase deamons
#

echo "Oracle 9i auto start/stop"

ORA_OWNER=oracle
ORA_HOME=/u01/app/oracle/product/9.2.0.1.0

case "$1" in
'start')

echo -n "Starting Oracle9i: "
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart

echo -n "Starting the Listener for 9i: " su - $ORA_OWNER -c "${ORA_HOME}/bin/lsnrctl start"

touch /var/lock/subsys/oracle9i
echo
;;

'stop')
echo -n "Shutting Oracle9i: "
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut

echo -n "Shutting down Listener for 9i: " su - $ORA_OWNER -c "${ORA_HOME}/bin/lsnrctl stop"

rm -f /var/lock/subsys/oracle9i
echo
;;

'restart')

echo -n "Restarting Oracle9i: "
$0 stop
$0 start

echo
;;

*)
echo "Usage: oracle9i {start | stop | restart }" exit 1

esac
exit 0

Nelson Baumgarten wrote:

 > Mark ;
 >             I have Redhat 8.0 with Oracle and I believe my startup and
 > shutdown work. You have to su to Oracle since the root runs all 
startups. I
 > am using rc5.d to start and stop. What you have to is make sure that the  > Oracle environment is set when oracle logs in. This is done .bash_profile.
 > If you just to SU oracle the .Bash_profile won't run. It only is run once  > when you login. I have a file in init.d called startoracle and it is linked
 > to S50 oracle in rc5.d. The file startoracle has the command;
 > su oracle --login --command=/opt/oracle/product/9.0.1/bin/dbstart. This
 > starts up oracle. I do a similar thing to shutdown oracle I use the 
command
 > su oracle --login --command=/opt/oracle/product/9.0.1/bin/dbshut to stop my
 > database. If you just do an su oracle as I said you do not execute the  > .bash_profile to reset your environment. The .bash_profile should be in the
 > oracle account home and set up your environment ORACLE_HOME, ORACLE_SID etc.
 > I hope this helps you. su --help explains the bash shell..
 > "Mark" <mark_at_somewhere.com> wrote in message
 > news:3db4362a$1_2_at_corp.newsgroups.com...
 >
 >>Hi,
 >>
 >>I still can't figure out why Oracle won't shutdown at reboot or system
 >>shutdown.  My dbora script is attached.  I have created K10dbora links
 >
 > from
 >
 >>/etc/rc0.d and /etc/rc6.d that look like this:
 >>lrwxrwxrwx   1 root     root         15 Oct 14  K10dbora ->
 >
 > ../init.d/dbora
 >
 >>/etc/init.d/dbora looks like this:
 >>-rwxr-xr-x   1 root     root          819 Oct 14 dbora
 >>
 >>I tried making the 'K' number unique - changed it to K01dbora, but no
 >
 > change
 >
 >>in behavior.  As I mentioned before, Oracle will start automatically 
using
 >>S99dbora links in /etc/rc3.d and /etc/rc5.d.  And if I manually run
 >>/etc/init.d/dbora stop, the database shuts down.  If I run shutdown -h
 >
 > now,
 >
 >>shutdown -r now, init 6 or init 0 the db won't shutdown.  Again, any help
 >>would be appreciated.  Thanks.
 >>
 >>Mark
 >>
 >>
 >>
 >>
 >>
 >>"Mark" <mark_at_somewhere.com> wrote in message
 >>news:3daf37b1_4_at_corp.newsgroups.com...
 >>
 >>>Hi,
 >>>
 >>>I am having a problem getting Oracle to shutdown automatically on my
 >>
 >>RedHat
 >>
 >>>8.0 installation.  I have dbora in /etc/init.d.  This script calls
 >>
 > dbstart
 >
 >>>and dbshut depending on start or stop usage.  If I manually run dbora
 >>
 >>stop,
 >>
 >>>the database shuts down.  So, I know that the script works.  I created a
 >>>link in /etc/rc0.d,  K10dbora, which points to /etc/init.d/dbora.  My
 >>>understanding is that this should cause the db to shutdown when the
 >>
 >>computer
 >>
 >>>is shut down.  Unfortunately it doesn't work.  BTW - the db starts
 >>>automatically(as it should)on boot up.  Now, K10 is not unique.  Does it
 >>>need to be?  I didn't think that it had to be, but I could be wrong.
 >>
 > Any
 >
 >>>insight on this would be much appreciated.  Thanks.
 >>>
 >>>Mark
 >>>
 >>>
 >>>
 >>>
 >>>
 >>>-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
 >>>http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 >>>-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
 >>
 >>
 >>
 >
 >
 > 
----------------------------------------------------------------------------
 > ----
 >
 >
 >
 >>
 >>
 >>-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
 >>http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 >>-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
 >

 >
 > Received on Mon Oct 21 2002 - 21:46:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US