Re: Automatic db shtudown on Linux

From: dmz17 <dmz17_at_nospam.nowhere.com>
Date: Mon, 21 Oct 2002 20:41:52 +0200
Message-ID: <pan.2002.10.21.18.41.49.82876_at_nospam.nowhere.com>


On Thu, 17 Oct 2002 15:37:51 +0000, Mark wrote:

> 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! =-----

Here is a script I use. It gets started/stopped from soft links in rc5.d and rc3.d

The 'set91' command just sets the Oracle environment. The dbstart.sh looks something like this:

lsnrctl start
sqlplus "/as sysdba" << __EOF
startup
exit
__EOF Here is the dbstop.sh script:

sqlplus "/as sysdba" << __EOF
shutdown immediate
exit
__EOF lsnrctl stop

#!/bin/sh
. /etc/rc.config

case "$1" in

'start')

       echo -n "Starting Oracle 9.0.1"
       su - oracle -c ". set9i; dbstart.sh" >
/dev/null &
       rc_status -v
       ;;
'stop')
       echo -n "Stopping Oracle 9.0.1"
       su - oracle -c ". set9i; dbstop.sh" >
/dev/null
       rc_status -v
       ;;

*)
       echo "Usage: oracle { start | stop }"
       ;;

esac
exit 0

I do not use the Oracle supplied scripts. Until recently, I did not even know of their existance....

Cheers,

dmz17 Received on Mon Oct 21 2002 - 20:41:52 CEST

Original text of this message