Sun Cluster Data Service for Oracle Application Server Guide for Solaris OS

Installing Oracle Application Server in Zones


Note –

This deployment example is designed for a single node cluster. It is provided simply as a concise guide to help you if you need to refer to an installation and configuration of Oracle Application Server.

This deployment example is not meant to be a precise guide to install and configure Oracle Application Server.

If you need to install Oracle Application Server in any other configuration, refer to the general purpose procedures elsewhere in this manual.


The instructions with this deployment example assumes that you are using the Oracle Application Server 10g version 10.1.2 for Solaris x86–64 platform and will configure Oracle Application Server on a ZFS highly available local file system.

The tasks you must perform to install and configure Oracle Application Server in the zones are as follows:

ProcedureExample: Prepare the Cluster for Oracle Application Server

Perform all steps within this example in the global zone.

  1. Install and configure the cluster as instructed in Sun Cluster Software Installation Guide for Solaris OS.

    Install the following cluster software components.

    • Sun Cluster core software

    • Sun Cluster HA for Oracle data service

    • Sun Cluster HA for Oracle Application Server data service

  2. Install and configure a Zettabyte file system.

    Create a ZFS pool.


    Note –

    The following zpool definition represents a very basic configuration for deployment on a single node cluster.

    You should not consider this example for use within a productive deployment, instead it is a very basic configuration for testing or development purposes only.



    Vigor5# zpool create -m /ZFSoracle HAZpool4 c1t6d0
    
  3. Add the Oracle Application Server logical hostname to /etc/hosts and /etc/inet/ipnodes.


    Vigor5# cat >> /etc/hosts <<-EOF
    192.168.1.153	oas10g.uk.sun.com oas10g
    EOF
    Vigor5# cat >> /etc/inet/ipnodes <<-EOF
    192.168.1.153	oas10g.uk.sun.com oas10g
    EOF
    

ProcedureExample: Configure zones z1 and z2 for Oracle Application Server

  1. On local storage create a directory for the non-global zones root path.


    Vigor5# mkdir /zones
    
  2. Create a temporary file for the whole root zones, for example /tmp/z1 and /tmp/z2, and include the following entries:


    Vigor5# cat > /tmp/z1 <<-EOF
    create -b
    set zonepath=/zones/z1
    EOF
    Vigor5# cat > /tmp/z2 <<-EOF
    create -b
    set zonepath=/zones/z2
    EOF
    
  3. Configure the non-global zones, using the files you created.


    Vigor5# zonecfg -z z1 -f /tmp/z1
    Vigor5# zonecfg -z z2 -f /tmp/z2
    
  4. Install the zones.

    Open two windows and issue the following command in each window.


    Vigor5# zoneadm -z z1 install
    Vigor5# zoneadm -z z2 install
    
  5. Boot the zones.


    Vigor5# zoneadm -z z1 boot
    Vigor5# zoneadm -z z2 boot
    
  6. Log in to the zones and complete the zone system identification.


    Vigor5# zlogin -C z1
    Vigor5# zlogin -C z2
    
  7. Close the terminal window and disconnect from the zone consoles.

    After you have completed the zone system identification, disconnect from the window your previously opened.


    Vigo5# ~.
    
  8. Import the ZFS pool into zone z1.

    Perform this step in the global zone only.


    Vigor5# zpool export -f HAZpool4
    Vigor5# zpool import -R /zones/z1/root HAZpool4
    
  9. Add the Oracle Application Server logical hostname to /etc/hosts in the zones.


    Vigor5# zlogin z1
    # cat >> /etc/hosts <<-EOF
    192.168.1.153	oas10g.uk.sun.com oas10g
    EOF
    # exit
    Vigor5# zlogin z2
    # cat >> /etc/hosts <<-EOF
    192.168.1.153	oas10g.uk.sun.com oas10g
    EOF
    # exit
    
  10. Create the Oracle Application Server userid in the zones.

    Perform this step from the global zone .


    Vigor5# zlogin z1
    # mkdir -p /ZFSoracle/oraInfra
    # groupadd -g 3000 dba
    # useradd -u 4000 -g 3000 -d /ZFSoracle/oraInfra -s /usr/bin/ksh oracle
    # exit
    Vigor5# zlogin z2
    # groupadd -g 3000 dba
    # useradd -u 4000 -g 3000 -d /ZFSoracle/oraInfra -s /usr/bin/ksh oracle
    # exit
    
  11. Setup file permissions in the ZFS pool.

    Perform this step in zone z1 only.


    Vigor5# zlogin z1
    # chown -R oracle:dba /ZFSoracle
    # exit
    
  12. Plumb the Oracle Application Server logical hostname in zone z1.

    Perform this step in the global zone.


    Vigor5# ifconfig e1000g0 addif oas10g up zone z1
    

ProcedureExample: Install Oracle Application Server in the zones


Caution – Caution –

The steps within this procedure are not precise steps to install Oracle Application Server. Refer to the relevant Oracle Application Server documentation for complete information.


  1. Mount the Oracle Application Server software in the zones.

    Perform this step in the global zone only.

    In this example, the Oracle Application Server software has been copied to node Vigor5 into directory /export/software/oracle/oasv1012.


    Vigor5# zlogin z1 mkdir -p /var/tmp/software
    Vigor5# mount -F lofs /export/software /zones/z1/root/var/tmp/software
    
  2. Install the Oracle Application Server software in zone z1.

    Perform this step from the global zone for zone z1.


    Note –

    The values specified here were those used by this deployment example. You should specify values that are relevant to your installation.


    While navigating through the Oracle Universal Installer specify the following:

    • Enter /ZFSoracle/oraInventory for the inventory directory.

    • Enter OH_INFRA as the name for the installation.

    • Enter /ZFSoracle/oraInfra for the Oracle home directory.

    • Select Oracle Application Server Infrastructure 10g 10.1.2.0.2.

    • Select High Availability and Replication.

    • Select Virtual host.

    • Select Custom Namespace.

    • Enter dc=uk,dc=sun,dc=com for the namespace.

    • Enter oas10g.uk.sun.com for the virtual host.

    • Enter orcl.uk.sun.com global database name.


    Vigor5# /usr/openwin/bin/xhost +
    Vigor5# zlogin z1
    # su - oracle
    $ DISPLAY=192.168.1.5:0.0
    $ TMP=/tmp
    $ export DISPLAY TMP
    $ cd /var/tmp/software/oracle/oasv1012/cd1
    $ ./runInstaller
    
  3. Setup the Oracle Application Server userid .profile.

    Perform this step after you have completed the installation of the Oracle Application Server software in zone z1 as user oracle.


    $ cat >> .profile <<-EOF
    ORACLE_HOME=/ZFSoracle/oraInfra
    ORACLE_SID=orcl
    export ORACLE_HOME ORACLE_SID
    EOF
    $ exit
    # exit
    
  4. Copy /var/opt/oracle from zone z1 to z2.

    Perform this step in the global zone only.


    Vigor5# cp -rp /zones/z1/root/var/opt/oracle /zones/z2/root/var/opt/oracle
    

ProcedureExample: Verify Oracle Application Server

  1. Verify the Oracle Application Server 10g Infrastructure.


    Vigor5# zlogin z1
    # su - oracle
    $ $ORACLE_HOME/bin/emctl status iasconsole
    TZ set to GB
    
    Oracle Enterprise Manager 10g Application Server Control Release 10.1.2.0.2
    Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
    http://oas10g.uk.sun.com:1156/emd/console/aboutApplication
    Oracle Enterprise Manager 10g Application Server Control is running.
    ------------------------------------------------------------------
    Logs are generated in directory /ZFSoracle/oraInfra/sysman/log
    $ $ORACLE_HOME/opmn/bin/opmnctl status
    
    Processes in Instance: IAS.oas10g.uk.sun.com
    -------------------+--------------------+---------+---------
    ias-component      | process-type       |     pid | status
    -------------------+--------------------+---------+---------
    LogLoader          | logloaderd         |     N/A | Down
    dcm-daemon         | dcm-daemon         |    6135 | Alive
    DSA                | DSA                |     N/A | Down
    OC4J               | OC4J_SECURITY      |    4781 | Alive
    HTTP_Server        | HTTP_Server        |    4546 | Alive
    OID                | OID                |    4558 | Alive
  2. Stop the 10g Infrastructure.

    Perform this step as user oracle in zone z1.


    $ $ORACLE_HOME/bin/emctl stop iasconsole
    $ $ORACLE_HOME/opmn/bin/opmnctl stopall
    
  3. Stop the Oracle Database and Listener.

    Perform this step as user oracle in zone z1.


    $ $ORACLE_HOME/bin/lsnrctl stop
    $ $ORACLE_HOME/bin/sqlplus "/ as sysdba"
    SQL> shutdown immediate
    SQL> quit
    $ exit
    
  4. Relocate the Oracle Application Server logical hostname to zone z2.

    Perform this step as user root in the global zone .


    Vigor5# ifconfig e1000g0 removeif oas10g
    Vigor5# ifconfig e1000g0 addif oas10g up zone z2
    
  5. Relocate the ZFS pool to zone z2.

    Perform this step as user root in the global zone .


    Vigor5# zpool export -f HAZpool4
    Vigor5# zpool import -R /zones/z2/root HAZpool4
    
  6. Start the Oracle Database and Listener in zone z2.


    Vigor5# zlogin z2
    # su - oracle-application-server-userid
    $ $ORACLE_HOME/bin/lsnrctl start
    $ $ORACLE_HOME/bin/sqlplus "/ as sysdba"
    SQL> startup
    SQL> quit
    
  7. Start the Oracle Application Server Infrastructure in zone z2.

    Perform this step as user oracle in zone z2.


    $ $ORACLE_HOME/opmn/bin/opmnctl startall
    $ $ORACLE_HOME/bin/emctl start iasconsole
    
  8. Verify the Oracle Application Server 10g Infrastructure.

    Perform this step as user oracle in zone z2.


    $ $ORACLE_HOME/bin/emctl status iasconsole
    TZ set to GB
    
    Oracle Enterprise Manager 10g Application Server Control Release 10.1.2.0.2
    Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
    http://oas10g.uk.sun.com:1156/emd/console/aboutApplication
    Oracle Enterprise Manager 10g Application Server Control is running.
    ------------------------------------------------------------------
    Logs are generated in directory /ZFSoracle/oraInfra/sysman/log
    $ $ORACLE_HOME/opmn/bin/opmnctl status
    
    Processes in Instance: IAS.oas10g.uk.sun.com
    -------------------+--------------------+---------+---------
    ias-component      | process-type       |     pid | status
    -------------------+--------------------+---------+---------
    LogLoader          | logloaderd         |     N/A | Down
    dcm-daemon         | dcm-daemon         |   14170 | Alive
    DSA                | DSA                |     N/A | Down
    OC4J               | OC4J_SECURITY      |   14054 | Alive
    HTTP_Server        | HTTP_Server        |   14012 | Alive
    OID                | OID                |   14017 | Alive
  9. Setup Oracle Database Permissions.

    Perform this step as user oracle in zone z2.


    $ $ORACLE_HOME/bin/sqlplus "/ as sysdba"
    SQL> grant connect, resource to homer identified by springfield;
    SQL> alter user homer default tablespace system quota 1m on system;
    SQL> grant select on v_$sysstat to homer;
    SQL> grant select on v_$archive_dest to homer;
    SQL> grant create session to homer;
    SQL> grant create table to homer;
    SQL> exit;
    $ chmod 6751 $ORACLE_HOME/bin/oracle
    
  10. Stop the Oracle Application Server 10g Infrastructure.

    Perform this step as user oracle in zone z2.


    $ $ORACLE_HOME/bin/emctl stop iasconsole
    $ $ORACLE_HOME/opmn/bin/opmnctl stopall
    
  11. Stop the Oracle Database and Listener.

    Perform this step as user oracle in zone z2.


    $ $ORACLE_HOME/bin/lsnrctl stop
    $ $ORACLE_HOME/bin/sqlplus "/ as sysdba"
    SQL> shutdown immediate
    SQL> quit
    $ exit
    # exit
    
  12. Unplumb the Infrastructure logical IP address .

    Perform this step as user root in the global zone .


    Vigor5# ifconfig e1000g0 removeif oas10g
    
  13. Export the ZFS pool.

    Perform this step as user root in the global zone .


    Vigor5# zpool export -f HAZpool4
    

ProcedureExample: Configure Cluster Resources for Oracle Application Server

Perform all steps within this example in the global zone.

  1. Register the required resource types.


    Vigor5# clresourcetype register SUNW.HAStoragePlus
    Vigor5# clresourcetype register SUNW.gds
    Vigor5# clresourcetype register SUNW.oracle_server
    Vigor5# clresourcetype register SUNW.oracle_listener
    
  2. Create the resource group.


    Vigor5# clresourcegroup create -n Vigor5:z1,Vigor5:z2 oas10g-rg
    
  3. Create the logical hosts.


    Vigor5# clreslogicalhostname create -g oas10g-rg -h oas10g oas10g-lh
    
  4. Create the HAStoragePlus resource in the wmq1-rg resource group.


    Vigor5# clresource create -g oas10g-rg -t SUNW.HAStoragePlus \
    > -p Zpools=HAZpool4 oas10g-ZFShas
    
  5. Enable the resource group.


    Vigor5# clresourcegroup online -M oas10g-rg
    

ProcedureExample: Enable the Oracle Application Server Software to Run in the Cluster

Perform all steps within this example in the global zone.

  1. Create the Oracle Database cluster resource.

    The Oracle permissions were previously setup in Step 9 from Example: Verify Oracle Application Server.


    Vigor5# clresource create -g oas10g-rg -t SUNW.oracle_server \
    -p Connect_string=homer/springfield \
    -p ORACLE_SID=orcl \
    -p ORACLE_HOME=/ZFSoracle/oraInfra \
    -p Alert_log_file=/ZFSoracle/oraInfra/admin/orcl/bdump/alert_orcl.log \
    -p Restart_type=RESOURCE_GROUP_RESTART \
    -p Resource_dependencies=oas10g-ZFShas \
    oas10g-ora
    
  2. Create the Oracle Listener cluster resource.


    Vigor5# clresource create -g oas10g-rg -t SUNW.oracle_listener \
    -p LISTENER_NAME=listener \
    -p ORACLE_HOME=/ZFSoracle/oraInfra \
    -p Resource_dependencies=oas10g-ZFShas \
    oas10g-lsr
    
  3. Enable the Oracle Database and Listener cluster resources.


    Vigor5# clresource enable -g oas10g-rg +
    
  4. Create and enable the Oracle Application Server cluster resource.


    Vigor5# cat > /opt/SUNWsc9ias/util/10gas_config <<-EOF
    RG=oas10g-rg
    RS_OPMN=oas10g-opmn
    RS_EM=oas10g-em
    
    ORACLE_HOME=/ZFSoracle/oraInfra
    ORACLE_SID=orcl
    OIAS_LHOST=oas10g
    OIAS_USER=oracle
    OIAS_ADMIN=dummy
    OIAS_INFRA=/var/opt/oracle
    OIAS_FQDN=dummy
    OIAS_OPMN=all
    
    RS_LH=oas10g-lh
    RS_HAS=oas10g-ZFShas
    RS_ORACLE=oas10g-ora
    RS_ORALSR=oas10g-lsr
    EOF
    Vigor5# /opt/SUNWsc9ias/util/10gas_register
    Vigor5# clresource enable -g oas10g-rg +
    

ProcedureExample: Verify the Sun Cluster HA for Oracle Application Server Resource Group

Perform this step in the global zone.

    Switch the Oracle Application Server resource group between the two zones.


    Vigor5# for node in Vigor5:z2 Vigor5:z1
    do
       clrg switch -n $node oas10g-rg
       clrg status oas10g-rg
    done