Vidya Bala's Blog

Search My Blog

Add RSS Feed

Friday, November 10, 2006

get familiar with OPMN……..

Especially in the 10g Application Server world I see a lot of PROD and DEV DBA’s relying only on the EM console to manage their Applications.
I personally prefer the command line interface. I think it is more robust and can come very handy.
Oracle® Process Manager and Notification Server(OPMN) – below is a quick overview of what you can do with opmn
Opmnctl lets you start/stop/reload/status all your application server components
cd $ORACLE_HOME/opmn/bin
a)opmnctl start: Start opmn daemon without starting opmn managed processes for local ias instance.
b)opmnctl startall:Start both the daemon and managed server processes
c)opmnctl stopall
d)opmnctl startproc ias-component=WebCache process-type=WebCache (start and stop individual Application Server Components)
e)opmnctl stopproc ias-component=WebCache process-type=WebCache
f) opmnctl validate opmn.xml – validates the xml syntax for opmn.xml
g)opmnctl help: Print a brief usage description.
h)opmnctl shutdown: Quickly shutdown opmn daemon and opmn managed processes for local ias instance. This request is similar to a stopall command but waits less time before initiating a forceful termination of the managed processes. After stopping all managed
processes, the opmn daemon will shutdown itself.

Opmn.xml has IAS component specific configuration information is located in ORACLE_HOME/opmn/conf/opmn.xml
For example if your ias component is a Reports Server
ias-component id="rep server name" status="enabled" id-matching="false” : defines the ias component
process-type id="ReportsServer" module-id="ReportsServices": the type of ias component
process-set id="rep_ogmapp4" restart-on-death="true" numprocs="1": helps you define run time arguments for this component

ORACLE_HOME/opmn/logs/ has the ias component specific logs

With release 10.1.3.1 OC4J grouping is allowed defined in OPM.xml as well basically a group of OC4J instances can be managed together

If you are clustered then OPMN.xml will need to be configured for Dynamic Discovery in opmn.xml

How to Deploy a J2ee Application using OC4J in 10g Application Server:

The belw can be done using the EM console but I prefer the command line dcmctl utility (Distributed Configuration Management (DCM) ) to deploy the j2ee Application.

a)Create OC4J component:
dcmctl createComponent -ct oc4j -co myComp
The above command should create a new OC4J component
ias-component process-type
OC4J myComp
b)Remove OC4J component
dcmctl removeComponent -co myComp
c) dcmctl listComponents
list all the components
c)data-sources.xml
cd $ORACLE_HOME/j2ee/mycomp/config
you should find the application.xml and data-sources.xml config file. Add your data-sources connection to data-sources.xml.

data-source
class="com.evermind.sql.DriverManagerDataSource"
name="htestDS"
location="jdbc/htestCoreDS"
xa-location="htestDS"
ejb-location="jdbc/htestDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="htest"
password="htest"
url="jdbc:oracle:thin:@localhost:1521:dev2"
inactivity-timeout="30"

d)Start your OC4J component “mycomp”
you should be able to see your new datasource htestDS listed when you use the EM console to look into datasources for mycomp

e)Deploy your ear file
dcmctl deployApplication -file /var/home/oracle/test/j2ee/build/ htest.ear -a htest -co myComp
once the deployment is complete , the application can be accessed
htpp://hostname:7777/appname
4j -co myComponent

f) to start/stop components and undeploy
dcmctl start -co myComp -d -v
dcmctl stop -co myComp -d -v
dcmctl restart -co myComp -d –v
dcmctl undeployApplication -a hrapp -co myComp
dcmctl removeComponent -co myComp

If you have not used the command line interface to manage your App Server environment – the above should get you started.To start and stop your EM agent use emctl ($ORACLE_HOME/bin)

3 Comments:

  • opmnctl let you show the ports used too with opmnctl status -l

    By Blogger Laurent Schneider, at 12:30 PM  

  • Nice sumup of opmn,very good.

    Sam
    http://www.appsdbablog.com

    By Blogger Sam, at 7:44 AM  

  • How to start oc4j in assertaion mode ?
    If I add -ea flag to oc4j start jvm parameter. 10.1.3 ias throws error and oc4j does not get started.

    By Blogger Archana, at 3:19 AM  

Post a Comment

<< Home