ODI 11gR1 introduces the capability to use OPMN to start and protect agent processes as services. Setting up the OPMN agent is covered in the following post and extensively in the ODI Installation Guide.
Unfortunately, OPMN is not installed along with ODI, and ODI 10g users who are really at ease with the old Java Wrapper are a little bit puzzled by OPMN, and ask: "How can I simply set up the agent as a service?".
Well... although the Tanuki Service Wrapper is no longer available for free, and the agentservice.bat script lost, you can switch to another service wrapper for the same result. For example, Yet Another Java Service Wrapper (YAJSW) is a good candidate.
To configure a standalone agent with YAJSW:
download YAJSW
Uncompress the zip to a folder (called %YAJSW% in this example)
Configure, start and test your standalone agent.
Make sure that this agent is loaded with all the required libraries and drivers, as the service will not load dynamically the drivers added subsequently in the /drivers directory.
Retrieve the PID of the agent process:
Open Task Manager.
Select View Select Columns
Select the PID (Process Identifier) column, then click OK
In the list of processes, find the java.exe process corresponding to your agent, and note its PID.
Open a command line prompt in %YAJSW%/bat and run: genConfig.bat <your_pid>
This command generates a wrapper configuration file for the agent. This file is called %YAJSW%/conf/wrapper.conf.
Stop your agent.
Edit the wrapper.conf file and modify the configuration of your service. For example, modify the display name and description of the service as shown in the example below.
Important: Make sure to escape the commas in the ODI encoded passwords with a backslash! In the example below, the ODI_SUPERVISOR_ENCODED_PASS contained a comma character which had to be prefixed with a backslash.
# Title to use when running as a console
wrapper.console.title=\"AGENT\"
#********************************************************************
# Wrapper Windows Service and Posix Daemon Properties
#********************************************************************
# Name of the service
wrapper.ntservice.name=AGENT_113
# Display name of the service
wrapper.ntservice.displayname=ODI Agent
# Description of the service
wrapper.ntservice.description=Oracle Data Integrator Agent 11gR3 (11.1.1.3.0)
...
# Escape the comma in the password with a backslash.
wrapper.app.parameter.7 = -ODI_SUPERVISOR_ENCODED_PASS=fJya.vR5kvNcu9TtV\,jVZEt
Execute your wrapped agent as console by calling in the command line prompt: runConsole.bat
Check that your agent is running, and test it again.This command starts the agent with the configuration but does not install it yet as a service.
To Install the agent as service call installService.bat
From that point, you can view, start and stop the agent via the windows services.
Et voilà !
Two final notes:
- To modify the agent configuration, you must uninstall/reinstall the service. For this purpose, run the uninstallService.bat to uninstall it and play again the process above.
- To be able to uninstall the agent service, you should keep a backup of the wrapper.conf file. This is particularly important when starting several services with the wrapper.