Sunday, June 7, 2009

Service Management

Service Management

R12 uses 10.1.3 fusion middle-ware AS stack, hence services in R12 is managed by OPMN (Oracle Process Manager and Notification Server).

OPMN consists of two main components (Oracle Process Manager) and (Oracle Notification Server).

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

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

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

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

Getting OPMN managed running process(es) status

bash-2.05$ ./adopmnctl.sh status


You are running adopmnctl.sh version 120.4

Checking status of OPMN managed processes...
Processes in Instance: SID_host.host.domain.com
---------------------+--------------------+-----------+---------
ias-component | process-type | pid | status
---------------------+--------------------+-----------+---------
OC4J | oafm | 13500 | Alive
OC4J | forms | 28358 | Alive
OC4J | oacore | 15899 | Alive
HTTP_Server | HTTP_Server | 23530 | Alive
ASG | ASG | N/A | Down

adopmnctl.sh: exiting with status 0
adopmnctl.sh: check the logfile /ebiz/oracle/SID/inst/apps/SID_host/logs/appl/admin/log/adopmnctl.txt for more information
Starting OPMN managed Services

Starting Complete OC4J container
bash-2.05$ ./adopmnctl.sh startproc ias-component=OC4J
Starting individual process-type(s)
bash-2.05$ ./adopmnctl.sh startproc ias-component=OC4J process-type= oafm
bash-2.05$ ./adopmnctl.sh startproc ias-component=OC4J process-type= forms
bash-2.05$ ./adopmnctl.sh startproc ias-component=OC4J process-type= oacore
Starting HTTP Server (Apache)
bash-2.05$ ./adopmnctl.sh startproc ias-component=HTTP_Server
Stoping OPMN managed Services

Stoping Complete OC4J container
bash-2.05$ ./adopmnctl.sh stopproc ias-component=OC4J
Stoping individual process-type(s)
bash-2.05$ ./adopmnctl.sh stopproc ias-component=OC4J process-type= oafm
bash-2.05$ ./adopmnctl.sh stopproc ias-component=OC4J process-type= forms
bash-2.05$ ./adopmnctl.sh stopproc ias-component=OC4J process-type= oacore
Stoping HTTP Server (Apache)
bash-2.05$ ./adopmnctl.sh stopproc ias-component=HTTP_Server
Benefits of OPMN

There are many benefits because of OPMN. To give an example,
Consider the scenario where one of your OC4J process has died. OPMN detects the death of the process which it manages and brings up in almost no time.
To elucidate this here is an example

bash-2.05$ ./adopmnctl.sh status


You are running adopmnctl.sh version 120.4
Checking status of OPMN managed processes...
Processes in Instance:  SID_host.host.domain.com
---------------------+--------------------+-----------+---------
ias-component | process-type | pid | status
---------------------+--------------------+-----------+---------
OC4J | oafm | 13500 | Alive
OC4J | forms | 15898 | Alive
OC4J | oacore | 15899 | Alive
HTTP_Server | HTTP_Server | 23530 | Alive
ASG | ASG | N/A | Down

adopmnctl.sh: exiting with status 0
adopmnctl.sh: check the logfile /ebiz/oracle/SID/inst/apps/SID_host/logs/appl/admin/log/adopmnctl.txt for more information ...

All the OPMN managed processes are alive. Lets see, how opmn reacts to the death of the oacore OC4J process. I have killed the process with PID - 15898

bash-2.05$ kill -9 15898


bash-2.05$ ./adopmnctl.sh status


You are running adopmnctl.sh version 120.4
Checking status of OPMN managed processes...
Processes in Instance:  SID_host.host.domain.com
---------------------+--------------------+-----------+---------
ias-component | process-type | pid | status
---------------------+--------------------+-----------+---------
OC4J | oafm | 13500 | Alive
OC4J | forms | 28358 | Init
OC4J | oacore | 15899 | Alive
HTTP_Server | HTTP_Server | 23530 | Alive
ASG | ASG | N/A | Down

adopmnctl.sh: exiting with status 0
adopmnctl.sh: check the logfile /ebiz/oracle/SID/inst/apps/SID_host/logs/appl/admin/log/adopmnctl.txt for more information ...


Within no time, OPMN detects the death and restarts the process it manages.(one or two seconds users will face the failures due to the process unavailability to serve the requests)

$LOG_HOME/ora/10.1.3/opmn/opmn.log is appened with the information ( it dumps the death detection and restart information)

08/05/02 12:34:04 [pm-process] Process Crashed: OC4J~forms~default_group~1 (691565399:15898) - Restarting
08/05/02 12:34:04 [pm-process] Starting Process: OC4J~forms~default_group~1 (691565400:0)
08/05/02 12:34:24 [pm-process] Process Alive: OC4J~forms~default_group~1 (691565400:28358)

This is one of greatest advantage you will get when you have R12, Even if oacore JVM crashes due to out of memory issue, opmn restarts after it detects OC4J has died.

What algorithm OPMN uses to detect the death?
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
Script Details

All the admin scripts are running the opmnctl in the background from the $ORACLE_CONFIG_HOME/opmn/bin directory. This environment variable is set in the $INST_TOP/apps/VIS_appl_node1/ora/10.1.3/VIS_appl_node1.env file. This contains all the required environment variables needed by opmnctl to run. So this file needs to be sourced before running the opmnctl for Ebiz.

bash-2.05# pwd
/ebiz/oracle/SID/inst/apps/SID_host/ora/10.1.3

bash-2.05# ls
Apache cfgtoollogs deconfig javacache opmn
VIS_appl_node1.env config j2ee network

bash-2.05# opmn/bin/opmnctl status
Unable to connect to opmn.
Opmn may not be up.

bash-2.05# source VIS_appl_node1.env

bash-2.05# opmn/bin/opmnctl status

Processes in Instance:  SID_host.host.domain.com
-------------------+--------------------+---------+---------
ias-component | process-type | pid | status
-------------------+--------------------+---------+---------
OC4J | oafm | N/A | Down
OC4J | forms | 8071 | Alive
OC4J | oacore | N/A | Down
HTTP_Server | HTTP_Server | 16572 | Alive
ASG | ASG | N/A | Down

No comments:

Post a Comment