Can you tell us which version of Oracle you have and which O/S you have?
Main Topics
Browse All TopicsHello,
I wrote 2 scrits to automatically start-up and/or shutdown a DB at boot-up time.
However , when rebooting the server, the scripts don,t work.
Any ideas ?
PT
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Complex task!
1. Update 'oratab' (under /etc or /var/opt/oracle) as:
<SID>:<ORACLE_HOME>:Y
where Y states that the database can be started up and shutdown using
dbstart/dbshut.
2. Create the service script:
/etc/init.d/dbora
Note: In Red Hat Advanced Server 2.1, the /etc/init.d is is a symbolic link to
/etc/rc.d/init.d
Content of the script is as follows:
#!/bin/bash
#
# chkconfig: 35 99 10
# description: Starts and stops Oracle processes
#
# 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=<Type your ORACLE_HOME in full path here>
ORA_OWNER=<Type your Oracle account name here>
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
# Start the TNS Listener
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
# Start the Intelligent Agent
if [ -f $ORA_HOME/bin/agentctl ]; then
su - $ORA_OWNER -c "$ORA_HOME/bin/agentctl start"
else
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_start"
fi
# Start Management Server
if [ -f $ORA_HOME/bin/oemctl ]; then
su - $ORA_OWNER -c "$ORA_HOME/bin/oemctl start oms"
fi
# Start HTTP Server
if [ -f $ORA_HOME/Apache/Apache/bi
su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/b
fi
touch /var/lock/subsys/dbora
;;
'stop')
# Stop HTTP Server
if [ -f $ORA_HOME/Apache/Apache/bi
su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/b
fi
# Stop Management Server
if [ -f $ORA_HOME/bin/oemctl ]; then
su - $ORA_OWNER -c "$ORA_HOME/bin/oemctl stop oms sysman/<password>"
fi
# Stop the Intelligent Agent
if [ -f $ORA_HOME/bin/agentctl ]; then
su - $ORA_OWNER -c "$ORA_HOME/bin/agentctl stop"
else
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_stop"
fi
# Stop the TNS Listener
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl 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
rm -f /var/lock/subsys/dbora
;;
esac
# End of script dbora
NOTE 1:
The lines:
# chkconfig: 35 99 10
# description: Starts and stops Oracle database
are mandatory since they describe the characteristics of the service where:
35 means that the service will be started in init levels 3 and 5 and will be stopped in other levels.
99 means that the service will be started at the near end of the init level processing
10 means that the service will be stopped at the near end of the init level processing
NOTE 2:
The Management Server is not shut down during service stop since it requires interaction and there is no harm in system killing the processes since the database is shut down already.
3. Set script permissions:
chmod 755 /etc/init.d/dbora
3. Register the Service
/sbin/chkconfig --add dbora
This action registers the service to the Linux service mechanism. On SuSE SLES7 and Red Hat Advanced Server 2.1 it will arrange symbolic links under
rc<runlevel>.d directories to /etc/init.d/dbora script.
NOTE 3:
The chkconfig utility calls 'insserv' to register and add services. The 'insserv'
version shipped with SUSE SLES8 is using the following header to define run level
and start/shutdown order.
### BEGIN INIT INFO
# Provides: dbora
# Required-Start: $local_fs $remote_fs $netdaemons
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 3 4 5 6
# Description: Oracle Startup
### END INIT INFO
On SuSE SLES7 the following symbolic links are created:
/etc/init.d/rc0.d/K10dbora
/etc/init.d/rc1.d/K10dbora
/etc/init.d/rc2.d/K10dbora
/etc/init.d/rc3.d/S99dbora
/etc/init.d/rc4.d/K10dbora
/etc/init.d/rc5.d/S99dbora
/etc/init.d/rc6.d/K10dbora
On Red Hat Advanced Server 2.1 the following symbolic links are created:
/etc/rc.d/rc0.d/K10dbora
/etc/rc.d/rc1.d/K10dbora
/etc/rc.d/rc2.d/K10dbora
/etc/rc.d/rc3.d/S99dbora
/etc/rc.d/rc4.d/K10dbora
/etc/rc.d/rc5.d/S99dbora
/etc/rc.d/rc6.d/K10dbora
The symbolic links are not created in United Linux 1.0 (SuSE SLES8 Edition)
with the 'chkconfig -add' command.
To have the symbolic links created run the following in addition:
/sbin/chkconfig --set dbora 35
After this action, the following symbolic links will be created pointing
to /etc/init.d/dbora script:
/etc/init.d/rc3.d/S01dbora
/etc/init.d/rc3.d/K22dbora
/etc/init.d/rc5.d/S01dbora
/etc/init.d/rc5.d/K22dbora
In all cases, the 'dbora' service will be running in runlevels 3,5 and it will
be stopped in other runlevels (i.e. 0,1,2,4,6).
Hello,
I have an Oracle 9i DB running on a Red Hat Linux Enterprise 3 (ES) server.
For the moment I just have the started DB, and trying to import an existing dump file.
Here is the script that I have:
-----
[root@Linux2005 init.d]# more dbora
#!/bin/sh
# chkconfig: - 20 80
# description: Oracle auto start-stop script
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# form which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id to the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/u01/app/oracle/p
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 lo
# will not prompt the user for any values
su - $ORACLE_OWNER -c $ORA_HOME/bin/dbstart &
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle lo
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut &
;;
esac
-----
Hope this helps ........
PT
Business Accounts
Answer for Membership
by: seazodiacPosted on 2004-09-10 at 06:25:27ID: 12026244
Tell use the procedures how you did it.?
did it work when you manually invoke the scripts? did it shutdown and restart ?
if the above checkpoint is done,
did you put into /etc/init.d folder and create a SXX and KXX link in the default run level of your system?