Question: I have five
instances on my Oracle HP/UX Server and I want to know how to automate
the startup of Oracle when the HP/UX server and HP/UX OS are
re-booted. How can I make Oracle
start automatically in HP/UX?
Answer:
For pre-written and pre-tested Oracle auto start scripts see
the Oracle script download.
Oracle provides
two HP/UX scripts that assist DBAs with starting and stopping the
HP/UX-based database: dbstart and dbshut.
The
dbstart utility reads the oratab file, shown in the example below.
The oratab file will reside in /etc. It contains three data items
separated by colons:
oracle > cat /etc/oratab| wc -l
oracle > cat /etc/oratab
MYSID1:/usr/oracle/9.2.0:Y
MYSID2:/usr/oracle/11.1.0:Y
MYSID3:/usr/oracle/10.2.03:N
Above we see that there are three instances on this
server, all on different releases of Oracle and the Oracle10g is
marked "N", so that database will not re-start when the HP/UX OS
re-starts.
1 - The first field is the Oracle SID.
2
- The second field is the home directory for that Oracle SID.
3 - The third column is a Y or N instructs Oracle
whether to start or stop the particular database when either the
dbstart or dbshut command is issued. The dbstart command simply
parses the oratab file and starts those databases that have a Y in
the third field. It also uses the ORACLE_HOME specified in the file
to connect internally to the database and issue the startup command.
The dbstart command can be added to the HP/UX
servers? initialization or run level scripts. This enables dbstart
to be executed each time the machine is booted or when it changes
run levels. The method for implementing this is platform specific,
as we see below.
Auto Start on HP/UX
For HP-UX version 10
and above, the system initialization scripts are contained in
/etc/rc<n>.d directories, where
?n? is the operating system run-level. These directories contain scripts that
begin with a K or S, followed by a number, and then a file name (S75cron). All
scripts that begin with 's? are executed at system startup in ascending order of
their number. Scripts beginning with ?K? (Kill)
are called at system shutdown time.
As a general rule of
thumb, the Oracle startup script should have a high sequence number
(S99dbstart), which will ensure that other system processes have been started
prior to Oracle. Likewise, the kill
scripts should have a low sequence number in order to shutdown
Oracle early in the process (K01dbshut).
Automating Oracle re-start within shell
scripts
Please see these important notes on embedding
Oracle re-start details within the
oraenv utility .
For more information on stopping and starting Oracle
automatically, see
"Oracle Shell Scripting" by Jon Emmons.
|
|
Get the Complete
Oracle SQL Tuning Information
The landmark book
"Advanced Oracle
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|