I write solutions to the problems I can't find much about elsewhere on the Web, also some code/script snippets that are absolutely awesome and make my life easier. Will be glad if someone finds these posts interesting and helpful!

Monday, May 3, 2010

How to make the Oracle Application Server 10g run as a Windows service

A problem that recently has been bugging the project I’m currently working on, was to make the Oracle Application Server 10g run as a service, so that it would be available without a user logging in and starting it up manually. We solved it with the use of an open source middleware project called JavaService, a pretty neat tool. Find below how.

Requirements:
Windows machine (the guide was tested with a vanilla Windows 2003 server installation)
Oracle Application Server 10g
The latest version (today 2.0.10) of JavaService

Actions:

Let’s say JavaService is unzipped to C:\JavaService-2.0.10
Then from the JavaService-2.0.10 directory execute:
rem To install the service with name OAS:
set ORACLE_HOME=C:\product\10.1.3.1\OracleAS_1
set CP=%ORACLE_HOME%\j2ee\home\oc4j.jar;%ORACLE_HOME%\jlib\startupconsole.jar;%ORACLE_HOME%\opmn\lib\optic.jar;%ORACLE_HOME%\lib\xmlparserv2.jar
javaservice -install OAS %ORACLE_HOME%\jdk\jre\bin\client\jvm.dll -Djava.class.path=%CP% -DORACLE_HOME=%ORACLE_HOME% -start oracle.appserver.startupconsole.view.Runner -params start -stop oracle.appserver.startupconsole.view.Runner -params stop -current %ORACLE_HOME%\j2ee\home\ -description "Oracle Application Server Service"
(in case the memory settings are not met (they are supposed to be taken from %ORACLE_HOME%\opmn\config\opmn.xml) add these 2 parameters
-XX:MaxPermSize=256m -Xmx256m right after the Java dll path)
rem To uninstall the service with name OAS:
javaservice -uninstall OAS
rem To view the configuration for installed Java service with name OAS:
javaservice -queryconfig OAS

Now the service OAS can be found among other services.

Should be also mentioned, that the Application Server better be stopped by the time you attempt to start the service.

Hope this helps.

No comments:

Post a Comment