Wednesday, July 11, 2012

Welcoming the new Agent with OPMN

Having seen how to create agent service on windows it must be clear that why Oracle has done away with this idea of Windows service using wrapper classes, the most obvious reason is to coax developers to use OPMN which stands for Oracle Process Management and Notification. You can find a lot of documentation  on this, one link is here http://docs.oracle.com/cd/B13597_05/core.904/b12057/intro.htm.
But to put it in layman's language, it is the Oracle's very own task/process manager just like windows Services (services.msc).
The very first advantage of this technique is that it eliminates the need to have expertise in creating services on different kinds of OS (Windows, Linux etc) like the one we saw in the previous post.
Besides that, OPMN is good and reliable.

To create an agent service using OPMN, you can refer to Oracle's very own yet so incomplete documentation here
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_opmn/odi_opmn.htm
or you can refer to John Goodwin's blog where he has put it in a very fine way
http://john-goodwin.blogspot.in/2010/12/managing-odi-11g-standalone-agents.html

What can go wrong while configuring ?
If you follow the steps mentioned in John's blog as they are mentioned, everything is bound to work properly. I faced some issues starting it in the first shot, I am listing a few ...

- Please dont miss changing \ to / in agentcreate.properties file, I bet most of us will miss it for the first time

- After getting those java errors while adding the agent, I searched if the environment variables are getting set when running the script odi_opmn_addagent.bat, but for some reason they weren't getting updated so I had to add them manually using Windows->Control Panel->System and Security->System->Advanced system settings->Environment variables. However, I feel this problem is very much specific to my machine.

- The agent service will install, start and will show status as alive when using 'opmnctl status' command, but when you test it in Studio, the test fails. To debug or to find the status of the agent, you need to check the log files in the location
C:\oracle\Middleware\user_projects\epmsystem1\diagnostics\logs\OPMN\opmn and my log file's name was
console~ODIAGENT1~odiagent~1.log.

If you are trying it out for the first time, it is advisable to have only one Work Repository associated to a Master since I had three repositories (WORK, WORKREP99 and WORK2 ) and it added to the confusion of specifying its name everywhere.

I got this error when checking the logs (test failed but opmn said the service is alive !!)

SEVERE: Agent ODIAGENT1 encountered an error: ODI-1405: Agent ODIAGENT1 start failure: the agent is not defined in the topology for master repository.
ODI-1405: Agent ODIAGENT1 start failure: the agent is not defined in the topology for master repository.
I ran the odiparams.bat again and tried my luck, this time it started but when I checked the log it had connected to another work repository named WORKREP99 whereas I had specified WORK in odiparams.bat and all other files

INFO: Scheduler started for work repository WORKREP99 on Agent ODIAGENT1.
Obviously logging into ODI using this WORKREP99 worked and the test was successful,
I will be digging deeper to find out whats going wrong and why is it taking another work repository.





No comments: