Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Auto Start Oracle on HPUX

Re: Auto Start Oracle on HPUX

From: Winnie Liu <oracle_dba_at_zdnetmail.com>
Date: 1998/10/28
Message-ID: <718or3$g7v@dfw-ixnews6.ix.netcom.com>

From Oracle Support, this is what you can do to auto start oracle

2. Soln# 2068091.6 AUTOMATIC STARTUP/SHUTDOWN OF ORACLE INSTANCES ON HP-UX

Solution ID         : 2068091.6For Problem         : 1019790.6
Affected Platforms  : HP/UX HP 98XX series
Affected Products   : Oracle Server - Enterprise Edition V7
Affected Components : RDBMS GenericAffected Oracle Vsn : V07.03.XXSummary:
AUTOMATIC STARTUP/SHUTDOWN OF ORACLE INSTANCES ON HP-UX UNIX+=+
Solution Description: =====================
Files of Interest In Your Oracle Installation

The following list summarizes the functions performed by the different Oracle
startup and shutdown scripts (which are invoked during system startup and
shutdown, respectively).     Script                    Description
-------------------------|--------------------------------------------------
$ORACLE_HOME/bin/dbstart |Ensures a clean startup of database instance(s),
                         |even after system failure
-------------------------|--------------------------------------------------
$ORACLE_HOME/bin/dbshut  |Ensures a clean shutdown for data base instances
-------------------------|--------------------------------------------------

/etc/oratab or |Contains a field that specifies whether a
/var/opt/oracle/oratab |particular database instance should be brought
|up/down at system startup/shutdown time. By |specifying "Y" in this field, the "dbstart" and |"dbshut" scripts bring this database instance up or |down. -------------------------|--------------------------------------------------
System V Versus BSD UNIX Startup and Shutdown Procedures

Since the system re-boot procedure is unique for each Unix Operating System, but can be generalized based on whether the Operating System is System V-based
or BSD-based, this section describes the generic approach taken by System V and BSD-based UNIX operating systems at system startup and shutdown time. For
more specific information, refer to the appropriate operating system-specific
section below.                         System V Procedures
- - - - - - - - - -
System V initialization scripts are contained in /etc/rc<n>.d directories where "n" is the run-level value of the script. A run-level of 0 usually signifies power shutdown mode, while a run-level of 2 signifies multi-user mode.

The directories contain initialization scripts such as "S75cron" and "K30tcp".
These scripts are named using the following method:

     [K or S][two-digit number][descriptive filename]

Names starting with "S" indicate scripts that are called at startup; names starting with "K" indicate scripts that are called at shutdown time. Scripts containing larger numbers in their names are executed after those with lower numbers. Oracle startup scripts typically contain larger numbers in their names, such as "S99oracle", indicating that the script should be run after the system has been started up. Oracle shutdown script names, on the other hand, usually contain smaller numbers, such as "K01oracle" indicating that the script should be run before system shutdown. BSD Procedures - - - - - - -
BSD-based systems, use /etc/rc*, files, such as /etc/rc, /etc/rc.local and so on, at system startup time.

During system shutdown, the /etc/shutdown command is invoked before any system or system-defined scripts. Some implementations invoke
/etc/rc.shutdown at shutdown time. HP-UX Version

9.0x: -------------------

     Relevant Files
        /etc/rc         -- System startup file
        /etc/shutdown   -- System shutdown executable
        /etc/shutdown.d -- System shutdown directory
All references to <oracle_owner> in this section should be replaced by the userid of the Oracle installation owner, and all references to <$ORACLE_HOME> should be replaced by the path to which $ORACLE_HOME points.

Unlike with Solaris and OSF/1, the HP/UX system startup and shutdown are relatively straightforward procedures. The /etc/rc script is executed at
system startup. To provide automatic startup for Oracle, insert the following
  line immediately before the logical end of the script:

     su <oracle_owner> -c <$ORACLE_HOME>/bin/dbstart

System shutdown is brought about by running the binary /etc/shutdown. This binary first executes all scripts and executables in the directory
/etc/shutdown.d, then brings the system down normally.
Use any of the following methods to bring the Oracle instances down before the system is halted.

     o Copy the $ORACLE_HOME/bin/dbshut script into /etc/shutdown.d.
     o Make /etc/shutdown.d/dbshut a symbolic link to
$ORACLE_HOME/bin/dbshut.
       o Write a short script such as the one below:
                                                              #!/bin/sh

       su <oracle_owner> -c <$ORACLE_HOME>/bin/dbshut
       Make sure that the script is owned and executable only by the
       super user.

Note:  if you are running Oracle instances from both Oracle version 6 and 7,
       use the "dbshut" script included with the Oracle version 7.
HP-UX Version 10.x: -------------------  Relevant Files
 /sbin/init.d/oracle     -- contains the main script for doing db
                                   startup and shutdown
 /etc/rc.config.d/oracle -- this file enables/disables automatic
                                   startup and shutdown of the databases
 /sbin/rc1.d/K100oracle ->/sbin/init.d/oracle
                                -- this link tells the system when to
execute
                                   the Oracle script with the 'stop' command
                                   in single user mode during system
                                   shutdown
 /sbin/rc2.d/S990oracle ->/sbin/init.d/oracle
                                -- this link tells the system when to
execute
                                   the Oracle script with the 'start'
command
                                   in multi-user mode during system startup
All references to <oracle_owner> in this section should be replaced by the userid of the Oracle installation owner, and all references to <$ORACLE_HOME> should be replaced by the path to which $ORACLE_HOME points.
     o Create an executable script /sbin/init.d/oracle for the startup
       and shutdown of Oracle
       Your script should attempt to start the database with the following
       command:         su - <oracle_owner> -c <$ORACLE_HOME>/bin/dbstart
       Your script should attempt to shut the database with the following
       command:         su - <oracle_owner> -c <$ORACLE_HOME>/bin/dbshut
       Make sure that the script is owned and executable only by the
       super user.
       For an example of the complete script, refer to page 6-12 of the
       7.2.2 Installation and Configuration Guide for HP 9000 series.
     o Create the file /etc/rc.config.d/oracle
       This file should contain:         ORACLE_START=1
       export ORACLE_START       o Edit /etc/oratab
       ORACLE_SID:ORACLE_HOME:Y|N
       where Y or N indicates whether you want the dbstart and dbshut
       scripts to be run
     o Make /sbin/rc1.d/K100oracle a symbolic link to /sbin/init.d/oracle
     o Make /sbin/rc2.d/S990oracle a symbolic link to /sbin/init.d/oracle
For Oracle 7.3.2.1 there is a problem with dbstart and dbshut accessing ?/bin/sqldba instead of ?/bin/svrmgrl. To get around this problem simply do the following:
o Replace SQL*DBA with the following script:
------------- Start Of Script--------------------------
##########################################
# This script is provided to support the #
# 'dbstart' & 'dbshut' commands only. #
##########################################
if [ $# = 1 ] && [ $1 = "command=exit" ] ; then echo 'SQL\*DBA: Release 7.X.X.0.0 - Support Version \c' date echo 'Copyright (c) Oracle Corporation 1996. All rights reserved.' exit 0 else # Add LD_LIBRARY_PATH to work round other problems.

    LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH     export LD_LIBRARY_PATH exec $ORACLE_HOME/bin/svrmgrl $@ fi

-------------- End Of Script --------------------------
o Save this script as $ORACLE_HOME/bin/sqldba o Add execute permission  $ chmod 755 sqldba
Note: Do not try to make a soft link. DBTART and DBSHUT will try to find

      the version of SQL*DBA which is provided by the above script.+==+ References: Received on Wed Oct 28 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US