Oracle Process Manager and Notification Server (OPMN)

The Oracle Process Manager and Notification Server (OPMN) is used, primarily, to control and monitor single or multiple Oracle Application Server components and instances via a command line interface. It has many features that allow a site to obtain high availability of the components that constitute Application Server 10 g . Of particular note is the capability of OPMN to detect a process that has died and restart it again. This gives developers the ability to deploy their applications in an environment where administrators can concern themselves with performance monitoring and security and hand the details of process death detection and restart to an automatic, centralized process. OPMN has many other capabilities that are primarily of interest to the Application Server 10 g administrator and will not be discussed in detail here, except to note that the control program for OPMN, opmnctl , is now the recommended way to start and stop all system components. This section will focus on the aspects of OPMN that relate to the system components most Oracle web developers interact with: OC4J servers, Oracle Reports Services, and Oracle Discoverer.

Note  

In previous versions of the application server, the Distributed Configuration Management ( dcmctl ) shell script, along with programs specific to system components (such as oidctl for the Oracle Internet Directory and webcachectl for the Web Cache), were used to start and stop system components. While those tools are still available, the only tool supported by Oracle to start and stop system components under Application Server 10g is opmnctl. When you start and stop components via the Enterprise Manager Application Server Control web site, the opmnctl executable is called to perform the necessary tasks . For more information regarding administration of Application Server 10g, see the Oracle Application Server 10g Administration Handbook by John Garmany and Donald K. Burleson (Osborne Oracle Press Series, 2004).

OPMN is made up of three components:

  • Oracle Notification Server This process communicates with the system components that make up Application Server 10 g . Server components subscribe to the notification server and, based on system events, have information published to them.

  • Oracle Process Manager This process is used to start, stop, restart, and detect the unexpected death of Application Server 10 g system components. opmn.xml is used to specify the components that Oracle Process Manager manages .

  • Process Manager modules These modules handle component-specific functionality. The Process Manager modules test system components to see if a component is alive and responding and holds information that is specific to that Application Server 10 g component.

In previous versions (9.0.2 and 9.0.3), you were limited to using OPMN to control the Oracle HTTP Server and OC4J instances. In version 9.0.4 (the one included with Application Server 10 g ), you can also use OPMN to control the following components:

  • Distributed Configuration Management (DCM) daemon (server)

  • Oracle Application Server Log Loader

  • Oracle Internet Directory

  • Oracle Application Server Port Tunnel

  • Oracle Application Server Web Cache

  • Oracle Application Server Discoverer

  • Oracle Application Server Wireless

  • Oracle Application Server Reports Services

  • Oracle Application Server ProcessConnect

Other components, such as Oracle Forms, Oracle Single Sign-On, and Oracle Portal, are implicitly managed by OPMN as they are implemented as applications running under OC4J containers. The only other processes required for Application Server 10 g that do not fall under the control of OPMN are

  • The metadata repository The Oracle database used by the infrastructure; this must be started using the startup command after connecting to the idle instance in Structured Query Language (SQL)*Plus as sysdba .

  • The listener for the metadata repository Use the lsnrctl command to start the listener.

  • The Enterprise Manager Application Server Control web site Use the emctl start iasconsole command to start the Application Server Control.

The opmnctl program requires the OPMN server be running before any commands can be passed to it. To start the OPMN server manually, use the opmnctl start command. To start the OPMN server and all of the processes specified in the opmn.xml file, use the opmnctl startall command. To stop the OPMN server and all of the processes specified in the opmn.xml file, use the opmnctl stopall command. The OPMN process does not read the opmn.xml file dynamically, so if you make any changes to it, you must tell the OPMN process to reread it. This can be accomplished with the opmnctl reload command. opmnctl can also be used to perform any of the operations mentioned above on individual components specified in the opmn.xml file or, by specifying the scope, all components within a specific instance, cluster, or farm. opmnctl commands can also be run in synchronous or asynchronous mode, which aids in the writing of scripts to startup or shutdown components.

opmnctl validate is used to validate the syntax in the opmn.xml file and opmnctl status is used to get the status of those components specified in the opmn.xml file. All of the opmnctl commands have an information page associated with them, similar to man pages in Unix. To see a command s information page, use the opmnctl usage <command> command.

Note  

The opmn.xml file is too large to include here in its entirety. In the following sections, parts of the opmn.xml will be listed with commentary to illustrate its behavior.

With Oracle Application Server 10g, most of the OPMN settings can be configured either through the Oracle Enterprise Manager web site or through OPMN s command-line utility opmnctl. Oracle strongly discourages editing the opmn.xml file by hand.

One of the main benefits of using OPMN to administer system components is its capability to start components in order. Many system components are dependant on other components running before they can be started. By default, OPMN is installed with all of the necessary start order dependencies for the components installed based on your installation type. This feature allows you to start all components with a single command: opmnctl startall. The open nature of OPMN and its corresponding opmn.xml file allows you to add your own components and their associated dependencies when starting up your application server.

Nor are you limited to just restarting a system component upon its expected or unexpected termination. Event scripts, similar to triggers in the database, can be configured to run and perform various tasks based on a components change of state. The event script types include prestart, prestop, and post-crash. Here is a section of the opmn.xml file that includes a prestart section that will run a shell script called restartoad.sh before starting the Oracle Discoverer server:

 <category id="EventScript">    <data id="prestart" value="/usr/AS10g/AS_HOME/discoverer /util/restartoad.sh"/> </category> 

Configuring OPMN for OC4J

After we created a new OC4J instance called OC4J_Dev, the following lines were created for us by Oracle in the opmn.xml file:

 1  <process-type id="OC4J_Dev" module-id="OC4J"> 2  <module-data> 3  <category id="start-parameters"> 4  <data id="java-options" value="-server -    Djava.security.policy=/usr/AS10g/AS_HOME/j2ee/OC4J_Dev    /config/java2.policy -Djava.awt.headless=true"/> 5  <data id="oc4j-options" value="-properties"/> 6  </category> 7  <category id="stop-parameters"> 8  <data id="java-options" value="-    Djava.security.policy=/usr/AS10g/AS_HOME/j2ee/    OC4J_Dev/config/java2.policy -Djava.awt.headless=true"/> 9  </category> 10 </module-data> 11 <start timeout="900" retry="2"/> 12 <stop timeout="120"/> 13 <restart timeout="720" retry="2"/> 14 <port id="ajp" range="3301-3400"/> 15 <port id="rmi" range="3201-3300"/> 16 <port id="jms" range="3701-3800"/> 17 <process-set id="default_island" numprocs="1"/> 18 </process-type> 
  • Line 1 begins the section that specifies the OPMN settings for a process; in this case, it s the OC4J_Dev instance.

  • Line 2 begins the module data section where the data OPMN will use to manage this component will be specified.

  • Lines 3-6 specify parameters passed to the Java environment upon startup of this container.

  • Lines 7-9 specify parameters passed to the Java environment upon shutdown of this container.

  • Lines 11-13 specify timeout parameters for this container.

  • Lines 14-16 specify port ranges for Apache JServ Protocol (AJP), RMI, and JMS services for this container.

  • Line 17 specifies the number of JVMs that will be used by the JMS server.

Configuring OPMN for Reports

Given the Reports server is made up of two components, the Reports server and the OC4J_BI_Forms instance, there are two sections of the opmn.xml file that need to be configured. This section lists the entry for the OC4J_BI_Forms instance:

 1  <process-type id="OC4J_BI_Forms" module-id="OC4J"> 2  <environment> 3  <variable id="DISPLAY" value="localhost:0"/> 4  <variable id="LD_LIBRARY_PATH"    value="/usr/AS10g/AS_HOME/lib:/usr/AS10g/AS_HOME    /lib:/usr/AS10g/AS_HOME/network/lib::/usr    /AS10g/AS_HOME/jdk/jre/lib/i386:/usr/AS10g/AS_HOME    /jdk/jre/lib/i386/server:/usr/AS10g/AS_HOME/jdk    /jre/lib/i386/native_threads"/> 5  </environment> 6  <module-data> 7  <category id="start-parameters"> 8  <data id="java-options" value="-server -    Djava.security.policy=/usr/AS10g/AS_HOME/j2ee/OC4J_BI_Forms    /config/java2.policy -Djava.awt.headless=true -Xmx512M -    Xbootclasspath^/p:/usr/AS10g/AS_HOME/vbroker4/lib/vbjboot.jar "/> 9  <data id="oc4j-options" value="-properties -userThreads "/> 10 </category> 11 <category id="stop-parameters"> 12 <data id="java-options" value="-    Djava.security.policy=/usr/AS10g/AS_HOME/j2ee/OC4J_BI_Forms    /config/java2.policy -Djava.awt.headless=true"/> 13 </category> 14 <category id="urlping-parameters"> 15 <data id="/reports/rwservlet/pingserver?start=auto" value="200"/> 16 </category> 17 </module-data> 18 <dependencies> 19 <database infrastructure-key="portal"/> 20 <managed-process process-type="HTTP_Server" process-set="HTTP_Server"  ias-component="HTTP_Server" autostart="true"/> 21 </dependencies> 22 <start timeout="900" retry="2"/> 23 <stop timeout="120"/> 24 <restart timeout="720" retry="2"/> 25 <port id="ajp" range="3301-3400"/> 26 <port id="rmi" range="3201-3300"/> 27 <port id="jms" range="3701-3800"/> 28 <process-set id="default_island" numprocs="1"/> 29 </process-type> 
  • Line 1 begins the section that specifies the OPMN settings for a process; in this case, it s the OC4J_BI_Forms instance.

  • Lines 2-5 specify environment variables that will be used by this OC4J instance.

  • Lines 6-10 specify Java parameters that will be used to start up this OC4J instance.

  • Lines 11-13 specify Java parameters that will be used to shut down this OC4J instance.

  • Lines 14-17 specify parameters for ping operations as part of OC4J process ping operations. AJP13 protocol is used to directly connect to the OC4J process and the HTTP return code is validated against the configured code.

  • Line 15 specifies the URL in the OC4J process that will be pinged; value is the expected HTTP return code.

  • Lines 18-21 specify dependencies for this OC4J container.

  • Line 20 specifies the component that must be running before attempting to start this component. In this case, the HTTP server must be up and running before an attempt is made to start the OC4J_BI_Forms instance.

  • Lines 22-24 specify timeout parameters for this container.

  • Lines 25-27 specify port ranges for AJP, RMI, and JMS services for this container.

  • Line 28 specifies the number of JVMs that will be used by the JMS server.

This code listing shows the opmn.xml entry for a specific Reports server:

 1  <ias-component id="rep_DevServer1" status="enabled" id- matching="false"> 2  <process-type id="rep_DevServer1" module-id="ReportsModule"> 3  <process-set id="rep_DevServer1" restart-on-death="true" numprocs="1"> 4  <environment> 5  <variable id =PATH value="<Path to uname command>" append="true"/> 6  </environment> 7  <module-data> 8  <category id="general-parameters"> 9  <data id="batch" value="yes"/> 10 </category> 11 <category id="restart-parameters"> 12 <data id="reverseping-timeout"value="300"/> 13 </category> 14 </module-data> 15 <start timeout="300" retry="3"/> 16 <stop timeout="300"/> 17 <restart timeout="300"/> 18 <ping timeout="30" interval="30"/> 19 </process-set> 20 </process-type> 21 </ias-component> 
  • Lines 1-3 define the Reports server.

  • Lines 4-6 specify environment variables for the Reports server.

  • Line 5 specifies where the uname command is.

  • Lines 7-14 specify a category that collects all the data that is common to the various process management tasks.

  • Lines 8-10 specify parameters used to construct the command line for starting and stopping of the Oracle Application Server Reports Services server.

  • Lines 11-13 specify parameters used in death detection.

  • Lines 15-18 specify timeout parameters for this container.

Configuring OPMN for Discoverer

The Oracle Discoverer server requires the following entries in the opmn.xml file for the OPMN process to manage it:

 1  <ias-component id="Discoverer"> 2  <environment> 3  <variable id="VBROKER_HOME" value="/usr/AS10g/AS_HOME/vbroker4"/> 4  <variable id="OSAGENT_PORT" value="16001"/> 5  <variable id="DISCO_DIR" value="/usr/AS10g/AS_HOME/"/> 6  <variable id="DISCO_JRE" value="/usr/AS10g/AS_HOME/jdk/jre"/> 7  <variable id="DISCO_PREFERENCE"     value="ias10gOracleDiscovererPreferences9"/> 8  <variable id="LD_LIBRARY_PATH"     value="/usr/lib:/usr/AS10g/AS_HOME/discoverer    /lib:/usr/AS10g/AS_HOME/vbroker4/lib:/usr/AS10g/AS_HOME/lib"    append="true"/> 9  <variable id="OAD_VERBOSE_LOGGING" value=""/> 10 <variable id="DC9_REG" value="/usr/AS10g/AS_HOME/discoverer/"/> 11 <variable id="PATH"    value="/usr/AS10g/AS_HOME/jdk/jre/bin:/usr/AS10g    /AS_HOME/vbroker4/bin:/bin" append="true"/> 12 </environment> 13 <process-type id="OSAgent" module-id="Disco_OSAgent" working-    dir="/usr/AS10g/AS_HOME/discoverer/util">?report         14 <ping interval="300"/> 15 <process-set id="OSAgent" numprocs="1"> 16 <module-data> 17 <category id="EventScript"> 18 <data id="prestart"    value="/usr/AS10g/AS_HOME/discoverer/util/restartoad.sh"/> 19 </category> 20 </module-data> 21 </process-set> 22 </process-type> 23 <process-type id="OAD" module-id="Disco_OAD" working-    dir="/usr/AS10g/AS_HOME/discoverer/util"> 24 <dependencies> 25 <managed-process ias-component="Discoverer" process-type="OSAgent"      process-set="OSAgent" autostart="true"/> 26 </dependencies> 27 <ping interval="0"/> 28 <process-set id="OAD" numprocs="1"> 29 <module-data> 30 <category id="bounce-parameters"> 31 <data id="bounce-process" value="false"/>/OC4J_Dev    32 <data id="bounce-time" value="23:55"/> 33 </category> 34 <category id="sessionserver-parameters"> 35 <data id="shutdown-event-name"      value="/usr/AS10g/AS_HOME/opmn/bin/opmn"/> 36 <data id="reverse-ping-interval" value="600"/> 37 </category> 38 </module-data> 39 </process-set> 40 </process-type> 41 <process-type id="PreferenceServer" module-id="Disco_PreferenceServer"    working-dir="/usr/AS10g/AS_HOME/discoverer" status="enabled"> 42 <process-set id="PreferenceServer" numprocs="1"/> 43 </process-type> 44 </ias-component> 
  • Lines 1-12 specify the Discoverer component and the environment variables needed by the Discoverer server.

  • Line 13: id= OSAgent must match the ID.

  • Line 14 specifies a time of five minutes for the ping interval of the OSAgent process (defined in Line 13).

  • Lines 17-19 define a script to be executed before the Discoverer server process is initiated.

  • Line 23: id= OAD must match the targets.xml entry; module-id= Disco_OAD defines the type of process and associates this configuration with a process module; working-dir= /usr/AS10g/AS_HOME/discoverer/util specifies where the log file associated with the OAD process will exist.

    Note  

    OAD stands for Object Activation Daemon (OAD). It is a background process that runs and manages Discoverer session components.

  • Lines 24-26 specify dependencies that must be running before this system component can begin.

  • Line 27 specifies the ping interval for the OAD process (defined in Line 23).

  • Line 28 specifies the number of OAD instances started for this process set. There should be at most one OAD instance running in one Oracle Application Server instance.

  • Lines 30-33 specifiy the bounce parameters for OAD. OAD can be scheduled for restart every day for a specific time period. It must run for 24 hours prior to scheduled setup.

  • Lines 34-37 are the category to specify the parameters for the session servers started by OAD. The session server is an Oracle Application Server Discoverer process that is launched during a user session. The Discoverer session server performs such operations as connecting to a database or opening a workbook. It provides the link between the Application Server Discoverer servlet or applet to the database.

  • Line 41: id= PreferenceServer is required and cannot be changed. The name must match the entry in the targets.xml file or elements and attributes will not work; module-id= Disco_PreferenceServer defines the type of process and associates the configuration with a process module; working-dir= /usr/AS10g/AS_HOME/discoverer specifies the location of the log file associated with the dis51pr process.

  • Line 42 specifies the number of preference server instances started for the process set. There should be at most one instance running in one Application Server instance.



Oracle Application Server 10g Web Development
Oracle Application Server 10g Web Development (Oracle Press)
ISBN: 0072255110
EAN: 2147483647
Year: 2004
Pages: 192

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net