Friday 21 June 2013

opmn overview

Metalink id says
==========

The Apache and OC4J processes are not started independently but are started, stopped and managed by the OPMN process.


This means that the OPMN process must be started first, then you ask OPMN to startup Apache and any OC4J processes that are needed.
R12 creates 3 OC4J instances:
  • OACore - runs OA Framework-based applications
  • Forms - runs Forms-base applications
  • OAFM (Oracle Apps Fusion Middleware) - runs web services, mapviewer, ascontrol


The startup/shutdown scripts for EBiz are located in directory defined by the environment variable $ADMIN_SCRIPTS_HOME

The scripts we will investigate further in this document are
  • adstrtal.sh : Starts all enabled services
  • adopmnctl.sh : Start just the OPMN process
  • adapcctl.sh : Startup Apache listener
  • adoacorectl.sh : Startup "oacore" OC4J
  • adformsctl.sh : Startup "forms" OC4J
  • adoafmctl.sh : Startup "oafm" OC4J



adstrtal.sh : Starts all enabled services


This script sends it's output to the log file $LOG_HOME/appl/admin/log/adstrtal.log
It first determines what services need to be started by scanning the $CONTEXT_FILE for "oa_service_group" entries that have "oa_service_group_status" = "enabled" and starts the services where "oa_service_status" is also set to "enabled"
The order of the entries in the $CONTEXT_FILE determines the order in which the enabled services are started
The "ctrl_script" entry defines the script that is executed to start the service, i.e. this links to the individual ad startup script
For example, given the following section in the $CONTEXT_FILE
    <oa_service_group type="root" title="Root Service">
        <oa_service_group_status oa_var="s_root_status">enabled</oa_service_group_status>
        <oa_service type="opmn">
            <oa_service_name oa_var="s_opmnname">Oracle Process Manager for VIS_myHost</oa_service_name>
            <oa_service_status oa_var="s_opmnstatus">enabled</oa_service_status>
            <oa_service_log oa_var="s_opmnlog">/oracle/VIS/inst/apps/VIS_myHost/logs/appl/admin/log/adopmnctl.txt</oa_service_log>
            <oa_service_env>
                <oa_env_include>web_home</oa_env_include>
            </oa_service_env>
            <timeout oa_var="s_opmntimeout">100</timeout>
            <ctrl_script oa_var="s_opmnctrl" osd="unix">/oracle/VIS/inst/apps/VIS_myHost/admin/scripts/adopmnctl.sh</ctrl_script>
        </oa_service>
    </oa_service_group> 
  1. adstrtal.sh will see the "oa_service_group_status" is set to "enabled" so looks inside this section.
  2. "oa_service_status" is also set to "enabled" so the script defined in the "ctrl_script" line (i.e. "adopmnctl.sh") will be executed with "start" passed as an argument to the script
  3. The "s_opmntimeout" variable specifies that the script will be given 100 seconds to complete the startup process, otherwise will generate an error. Each service has it's own timeout variable


=======================================


adopmnctl.sh : Start just the OPMN process


It is the OPMN process that actually starts and manages all other AS10g services, so this MUST be started correctly first in order for any of the other services to also start
Script arguments:
  • start = starts the OPMN service
  • status = show current status of all services
  • stop = stop OPMN service
This is an Ebiz specific wrapper script which sets the environment then eventually calls: 

    $ORA_CONFIG_HOME/10.1.3/opmn/bin/opmnctl

Output from the script is captured in log file 
    $LOG_HOME/appl/admin/log/adopmnctl.txt

Also check the OPMN log files
$LOG_HOME/ora/10.1.3/opmn directory
    opmn.dbg
    opmn.out
    opmn.log

OPMN is using the configuration file located at $ORA_CONFIG_HOME/10.1.3/opmn/conf/opmn.xml
This file defines the "ias-component" that are being managed and control information about these modules. For example:-
......................
<ias-component id="IASPT" status="disabled">
......................
......................
<ias-component id="OC4J">
    <process-type id="home" module-id="OC4J" status="disabled"
......................
......................
    <process-type id="oacore" module-id="OC4J" status="enabled" working-dir="$ORACLE_HOME/j2ee/home">
        <module-data>
            <category id="start-parameters">
                <data id="java-options" value="-server -verbose:gc -Xmx512M ............/>
                <data id="java-bin" value="/oracle/VIS/inst/apps/VIS_myHost/admin/scripts/java.sh"/>
                <data id="oc4j-options" value="-out ............./>
            </category>
            <category id="stop-parameters">
                <data id="java-options" value="-server -verbose:gc -Xmx512M ............/>
            </category>
        </module-data>
        <start timeout="600" retry="2"/>
        <stop timeout="120"/>
        <restart timeout="720" retry="2"/>
        <port id="default-web-site" range="21500-21504" protocol="ajp"/>
        <port id="rmi" range="20000-20004"/>
        <port id="jms" range="23000-23004"/>
        <process-set id="default_group" numprocs="2"/>
    </process-type> 


NOTE - If the service is enabled in CONTEXT.xml file, but disabled in opmn.xml then the eBiz script will run and complete successfully, but the service will not be started by OPMN. The log files will show why the service is not started in this case
You can check the OPMN processes are running with the following command:-
    ps -ef | grep opmn | grep -v grep




In R12 services are managed by OPMN(Oracle process manager and notification server).

OPMN COMPONENTS
==============
OPMN consists of two main components

1) Oracle Process Manager

2) Oracle Notification Server

1)Oracle Process Manager is responsible for below things.
=======================================
1) starting
2) stopping
3) restarting
4) monitoring the services it manages (this includes death detection and automatic restart of the process).


2) Oracle Notification Server

Oracle Notification Server is the transport mechanism for failure, recovery, startup, and other related notifications between components in AS.


Single configuration file(opmn.xml) is used OPMN to manage the services.
Config file location is given as $ORA_CONFIG_HOME/10.1.3/opmn/conf/opmn.xml

To see more in details
========================
http://docs.oracle.com/cd/B13597_05/core.904/b12057/common.htm#CACHJAGG

http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/core.1013/b15976/opmnctl.htm

wonderful document on opmn
==========================
http://isu.ifmo.ru/docs/IAS904/core.904/b12057/intro.htm#1015088

http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/core.1013/b15976/opmnctl.htm


OPMN SERVICES

Services managed by opmn are (grep process-type opmn.xml)

1) HTTP_Server
2) oacore
3) forms
4) oafm


Starting OPMN managed Services

Starting Complete OC4J container
=================================

 ./adopmnctl.sh startproc ias-component=OC4J

Starting individual process-type(s)

./adopmnctl.sh startproc ias-component=OC4J process-type=oafm              
./adopmnctl.sh startproc ias-component=OC4J process-type=forms
./adopmnctl.sh startproc ias-component=OC4J process-type=oacore



Starting HTTP Server (Apache)
      
./adopmnctl.sh startproc ias-component=HTTP_Server

Stoping OPMN managed Services

Stoping Complete OC4J container

./adopmnctl.sh stopproc ias-component=OC4J
    

Stoping individual process-type(s)
       
 ./adopmnctl.sh stopproc ias-component=OC4J process-type= oafm              
 ./adopmnctl.sh stopproc ias-component=OC4J process-type= forms
 ./adopmnctl.sh stopproc ias-component=OC4J process-type= oacore
    

Stoping HTTP Server (Apache)
./adopmnctl.sh stopproc ias-component=HTTP_Server

Benefits of OPMN

OPMN detects the death of the process which it manages and brings up in almost no time.
1) OS process is checked by OPMN for every 2 seconds.
2) forward ping: periodically OPMN pings the process for every 20 seconds and expects response
3) reverse ping: every 20 seconds managed process sends OPMN a ping notification.

Read more on http://www.oracle.com/technetwork/middleware/ias/opmn-101310-faq-128379.pdf


Where to look for apache logs in ebs R12?
http://abduulwasiq.blogspot.in/2013/05/how-to-troubleshoot-oracle-http-server.html


Thanks for visiting my blog !!!!!!!!!!!!!!

No comments:

Post a Comment