Welcome to OracleGiants.com!     

Oracle 10g DBA & Business Intelligence Resources.

Oracle 10g Application Server: Multiple Home Installation of Oracle 10g Application Server 10g R2 on SLES

"Einstein" 9/27/2006

 

            SLES’ orarun package includes a number of helpful scripts for managing Oracle processes through Yast in their /etc/sysconfig Editor and their Runlevel Editor tools.  I did not see a way in the /etc/init.d/oracle script to manage multiple oracle homes starting application server components.  Our current install requires Oracle Infrastructure, Portal, Discoverer and Wireless to run on the same machine.  The install was split so that Infrastructure had its own home and Discoverer, Portal and Wireless were installed in another.  I modified the oracle init.d script to a new script called oas. 

            The first step was to modify the flags in the /etc/sysconfig/oracle script to ensure that the startup options could be managed through the /etc/sysconfig editor in Yast.  I backed up the /etc/sysconfig/oracle and /etc/init.d/oracle scripts and renamed them each to oas.  I didn’t want to delve into all the kernel parameters so I left that section intact.  The big addition to the /etc/sysconfig/oas script was a flag for the ORACLE_HOME to be set with each component.  As you can see in the portion of script below, I used the INFRA_HOME and OAS_HOME variables to manage these separately as well as tag them so they showed up in the editor properly.

## Path:  Productivity/Databases/Tools/Oracle/infra

## Type:        yesno

## Default:     no

#

# Start Oracle Infrastructure automatically? Set to "yes" to enable database

# startup automatically at system boot.

#

START_ORACLE_INFRA="yes"

## Path:  Productivity/Databases/Tools/Oracle/infra

## Type:        string

## Default:     ""

#

# home directory for infrastructure install

#

INFRA_HOME="/opt/oracle/10gR2ASInfra"

## Path:  Productivity/Databases/Tools/Oracle/infra

## Type:        yesno

## Default:     no

#

# Start Infrastructure EM agent

#

START_INFRA_AGENT="yes"

## Path:  Productivity/Databases/Tools/Oracle/OAS

## Type:        yesno

## Default:     no

#

# Enable clients on other computers to connect to the database

#

START_OAS="yes"

## Path:  Productivity/Databases/Tools/Oracle/OAS

## Type:        string

## Default:     ""

#

# home directory for Application Server install

#

OAS_HOME="/opt/oracle/10gR2AS"

## Path:  Productivity/Databases/Tools/Oracle/OAS

## Type:        yesno

## Default:     no

#

# Start Infrastructure EM agent

#

START_OAS_AGENT="yes"

Once those variables are set in /etc/sysconfig/oas the /etc/init.d/oas script needs to be modified to read the new parameters and manage the correct services for them.  I deleted much of the original orarun oracle script because it dealt with trying to figure out which version of Oracle was running and start database services.  I replaced the start section to only detect the processes I was interested in starting for this machine using Oracle’s emctl and opmnctl utilities.  There is also a detection area which checks to ensure these utilities exist before it tries to run them further down in the script.  The two script blocks below are the Infrastructure portions of the code I added for starting the processes.  The OAS portions are very similar, only they use the OAS_HOME and check the OAS versions of the /etc/sysconfig/oas parameters.

    if [ ! -x $INFRA_HOME/opmn/bin/opmnctl -a ${START_ORACLE_INFRA:-no} = "yes" ]; then

      echo "${warn}Can't find needed file in infra_home: opmnctl - Setting START_ORACLE_INFRA = no $norm"

      START_ORACLE_INFRA="cannot";

    fi

    if [ ! -x $INFRA_HOME/bin/emctl -a ${START_INFRA_AGENT:-no} = "yes" ]; then

      echo "${warn}Can't find needed file in infra_home: emctl - Setting START_INFRA_AGENT = no $norm"

      START_INFRA_AGENT="cannot";

    fi

     echo -n "  - Starting Oracle Infrastructure EM Console..."

    if [ "${START_INFRA_AGENT:-no}" = "yes" ]; then

       test -x $INFRA_HOME/bin/emctl && su - $ORACLE_OWNER -c "export ORACLE_HOME=$INFRA_HOME; $INFRA_HOME/bin/emctl start iasconsole > /dev/null"

       if [ "$?" != "0" ]; then rc_failed; else rc_failed 0; fi

       rc_status -v -r

    else

       if [ ${START_INFRA_AGENT:-no} = "cannot" ]; then

         rc_status -s

       else

         rc_status -u

       fi

    fi

    rc_reset

    echo -n "  - Starting Oracle Infrastructure..."

    if [ "${START_ORACLE_INFRA:-no}" = "yes" ]; then

       su - $ORACLE_OWNER -c "export ORACLE_HOME=$INFRA_HOME; $INFRA_HOME/opmn/bin/opmnctl startall > /dev/null"

       if [ "$?" != "0" ]; then rc_failed; else rc_failed 0; fi

      rc_status -v -r

    else

       if [ ${START_ORACLE_INFRA:-no} = "cannot" ]; then

         rc_status -s

       else

         rc_status -u

       fi

    fi

    rc_reset

In the stop section I cut out all their database processes and replaced that part with the services I am using on this install.  Again, I have only included the lines for Infrastructure as the OAS lines are almost identical with the exception of the ORACLE_HOMEs

    test -x $INFRA_HOME/opmn/bin/opmnctl && test "${START_ORACLE_INFRA:-no}" = "yes" && echo -n "Shutting down Oracle Infrastructure: " && (su - $ORACLE_OWNER -c "export ORACLE_HOME=$INFRA_HOME; $INFRA_HOME/opmn/bin/opmnctl stopall > /dev/null"; rc_status -v -r)

    test -x $INFRA_HOME/bin/emctl && test "${START_INFRA_AGENT:-no}" = "yes"      && echo -n "Shutting down Infrastructure Enterprise Manager: " && (su - $ORACLE_OWNER -c "export ORACLE_HOME=$INFRA_HOME; $INFRA_HOME/bin/emctl stop iasconsole > /dev/null"; rc_status -v -r)

Once these modifications are made I can now use Yast to manage which processes I want to start and also at which runlevels I want them to start.  Here are the screenies from YastàSystemà/etc/sysconfig Editor and YastàSystemàRunlevel Editor.

Yast Screenshot

 

Yast Screenshot

 

Use Xattr CloudFiler™ to dedup, encrypt and move your RMAN backups to the cloud.

Recent Posts

OptionalRegion1
This site recommends Burleson Consulting for DBA Support & Consulting.

We are currently paying for accepted Oracle 10g DBA & Business Intelligence articles, scripts, tips & tricks. Send yours to the editor and we will review within three weeks.

Learn more

Editorial submissions & questions: editor@oraclegiants.com

 

 

This site is moderated by an:
Oracle Certified Professional
Oracle ACE

 

  Classic Car Online - The #1 spot for classic and muscle car enthusiats
2010 OracleGiants.com