Home » Infrastructure » Linux » Oracle Automatic startup/shutdown on Fedora Core
Oracle Automatic startup/shutdown on Fedora Core [message #138093] Mon, 19 September 2005 23:58 Go to next message
dcabbar
Messages: 2
Registered: September 2005
Junior Member
Hi Everyone,

I have followed the directions at
http://www.oracle-base.com/articles/10g/OracleDB10gInstallationOnFedora4.php

to install Oracle on Fedora Core, and it worked great. But, since I am not that advanced in linux, I had really hard time starting/stopping oracle automatically via init.d scripts.

After debugging rc calls, figured out the /etc/init.d/dbora script provided there and relevant directions does not work. Hence, I wanted to share my experience with you.

First of all, I looked at mysqld/httpd scripts in /etc/init.d and start run level there is 5, and stop runlevel is 6, so instead of 0 & 3 suggested on the web page above, I used the following links as follows:

ln -s /etc/init.d/dbora /etc/rc6.d/K10dbora
ln -s /etc/init.d/dbora /etc/rc5.d/S99dbora


Furthermore, the dbora script provided on the web page does not shutdown Oracle during a reboot, because fedora's /etc/rc.d/rc script checks to see if there is a file named /var/lock/subsys/dbora during the shutdown and if it can not find this file, it does not try to stop that service (simply skips it). Hence, the dbora script should be modified as below.

Hope this helps people.
Thanks...

#!/bin/bash

# Oracle auto start-stop script.
# 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=/home/oracle/dbms/product
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/lsnrctl start"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
RETVAL=$?
[ $RETVAL = 0 ] && touch /var/lock/subsys/dbora
;;
'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
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
RETVAL=$?
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/dbora
;;
esac

Re: Oracle Automatic startup/shutdown on Fedora Core [message #138812 is a reply to message #138093] Sat, 24 September 2005 00:45 Go to previous messageGo to next message
Frank Naude
Messages: 4570
Registered: April 1998
Senior Member
Very useful information - thanks!

Best regards.

Frank
Re: Oracle Automatic startup/shutdown on Fedora Core [message #143039 is a reply to message #138812] Tue, 18 October 2005 21:05 Go to previous messageGo to next message
asifameer
Messages: 2
Registered: October 2005
Junior Member
Hi dcabbar,

I had the same problem with oracle not starting up. I am going to try your solution and see if it works. But I wanted to know one more thing, being a Linux newbie myself, I want to know how you debugged the startup problem with the initial script given in the web site. I could not locate a log file that mentioned the output of the startup scripts (errors or debug messages etc..) Could you please let me know? Thanks!

Asif
Re: Oracle Automatic startup/shutdown on Fedora Core [message #143477 is a reply to message #143039] Thu, 20 October 2005 09:53 Go to previous messageGo to next message
asifameer
Messages: 2
Registered: October 2005
Junior Member
Still could not find a log of the startup sequence....in any case, I was able to run the dbora script directly and debug the problem (just ran it as "dbora start"). The dbstart and dbshut scripts in the oracle bin directory where looking for the oratab file in the wrong place (/var/opt/oracle/oratab). I had my oratab in /etc/oratab. So just modified the two script and everything worked fine.

Asif
Re: Oracle Automatic startup/shutdown on Fedora Core [message #143547 is a reply to message #143477] Thu, 20 October 2005 17:28 Go to previous message
dcabbar
Messages: 2
Registered: September 2005
Junior Member
FYI: Actually, I did not look at some log files, but used the magical "echo" command to debug what was going on within these scripts...
Previous Topic: Listener Failed on New SUSE server
Next Topic: installiation of oracle dba 10 g release 1(10.1.0.2)on fedora core 3 with dev 6i
Goto Forum:
  


Current Time: Wed Dec 01 21:33:08 CST 2021