Starting/stopping Oracle automatically

From: Morten <morten_skovgaard_at_hotmail.com>
Date: Thu, 29 Nov 2001 09:08:20 +0100
Message-ID: <3c05ecf5$0$229$edfadb0f_at_dspool01.news.tele.dk>


Hi!

I've finally made Oracle 9i run on my Linux RedHat 7.2 system. I'd like to start the database when I boot the system and shut it down nicely when I shut down Linux. In the installation guide there is a procedure which includes creating a small shell script and linking this to the appropriate runlevel.

I've followed the procedure below but the database doesn't start. I'm pretty sure it's because it doesn't get the 'start' parameter because if I try to run this in the SysV runlevel editor it just stops just before the line: case "$1" in 'start') but if I run the script manually and pass the parameter start it works fine.

Does anybody know how to make this work?

/Morten

The following is from the Oracle installation guide:

In the /etc/init.d directory, create a dbora script similar to the following, if

it does not already exist. Be sure to give the full path of the dbstart utility.

#!/bin/sh

# Set ORA_HOME to be equivalent to the $ORACLE_HOME

# from which you wish to execute dbstart and dbshut;

#

# Set ORA_OWNER to the user id of the owner of the

# Oracle database in ORA_HOME.

ORA_HOME=/u01/app/oracle/product/9.0.1

ORA_OWNER=oracle

if [! -f $ORA_HOME/bin/dbstart]

then

echo "Oracle startup: cannot start"

exit

fi

case "$1" in

'start')

# Start the Oracle databases:

# The following command assumes that the oracle login

# will not prompt the user for any values

su - $ORA_OWNER -c $ORA_HOME/bin/dbstart &

;;

'stop')

# Stop the Oracle databases:

# The following command assumes that the oracle login

# will not prompt the user for any values

su - $ORA_OWNER -c $ORA_HOME/bin/dbshut &

;;

esac

3. Create symbolic links to the dbora script in the appropriate run-level script

directories, as follows:

# ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora

# ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
Received on Thu Nov 29 2001 - 09:08:20 CET

Original text of this message