1846581 Members
2183 Online
110256 Solutions
New Discussion

Database Start UP

 
SOLVED
Go to solution
Timothy Kaye
Occasional Contributor

Database Start UP

AT present when the server is rebooted none of the oracle databases start up.

I have several scripts which i run manuall to start the DB's.

Am i able to just create the scripts in /sbin/init.d myself?

I'd appreciate any information
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: Database Start UP

Timothy:

If you haven't read, read either of these documents:

/usr/share/doc/start_up.txt

http://docs.hp.com/hpux/onlinedocs/os/startup.html

The file /sbin/init.d/template is a good starting place for making your own start/stop scripts.

The /sbin/init.d directory contains all scripts used to startup and shutdown various subsystems.

Each script under /sbin/init.d should perform BOTH the startup and shutdown functions. In order to control the functionality within the script, each must also support standard arguments and exit codes. Scripts must be written for the POSIX shell. A template script may be found in /sbin/init.d/template.

There is no reason why the startup and shutdown script cannot start/kill multiple, but related processes. Remember to choose the appropriate rc.d directory -- one (1) is for core services; two (2) is for multiuser run-state; three (3) is for networked, multi-user; and four (4) is for graphical interfaces. Depending on the processes you are starting, or stopping, you want to make sure prerequisite services exist.

Each script in /sbin/init.d performs BOTH the startup and shutdown functions, and each will have two links pointing towards the script from /sbin/rc*.d: one for the start action and one for the stop action.

Start scripts begin with "S"; Kill (stop) scripts begin with "K". The order of execution for kill scripts is the reverse of the startup ones.

Subsystems are killed in the opposite order they were started. This implies that kill scripts will generally not have the same numbers as their start script counterparts. For example, if two subsystems must be started in a given order due to dependencies (e.g., S111sys1 followed by S222uses_sys1), the counterparts to these scripts must be numbered so that the subsystems are stopped in the opposite order in which they were started (e.g., K555uses_sys1 followed by K777sys1).

Also, kill scripts for start scripts in directory /sbin/rcN.d reside in /sbin/rc(N-1).d. For example /sbin/rc3.d/S123system2 and /sbin/rc2.d/K654system2 might be start/kill counterparts.

...JRF...

Re: Database Start UP

Hi,

You can start and shutdown anything when system booting or shutdown.
Rename any script from /sbin/init.d and change according to your requirment and copy /etc/rc.config.d and also link the same script from /sbin/init.d to /sbin/rc1.d with K???scriptname and also link to /sbin/rc2.d with S???scriptname.

Thanks
Ron Gordon
Advisor

Re: Database Start UP

additionally don't forget to set in the /etc/oratab file the $ORACLE_SID:$ORACLE_HOME:[N/Y] to Y
Carlo Henrico_1
Regular Advisor

Re: Database Start UP

In the documentation there is a step by step guide to do this. Here it is:

1. Edit the /etc/oratab file
DB entries must be as follows:

ORACLE_SID:ORACLE_HOME:Y

The last parameter (Y/N) determines whether you want it to start/stop the db automatically.

2. An entry for each DB you want to start/stop must have a Y at the end

3. Create a file named dbora in the /sbin/init.d directory if it does not exist yet

4. It should contain the following:

#!/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=/oracle/app/product/815
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 &
;;
5. Link dbora by entering

ln -s /sbin/init.d/dbora /sbin/rc0.d/K10dbora
ln -s /sbin/init.d/dbora /sbin/rc0.d/S99dbora
Live fast, die young - enjoy a good looking corpse!