Sunday, July 8, 2012

Start Oracle BI 10g on Windows

This is not AYA story of startup scripts for Oracle BI 10g but a way how to enable services startup on Windows to be similar like one on Linux. It is more then known problem on any Windows OBI 10g installation that C:\OracleBI\oc4j_bi\bin\oc4j.cmd -start has to be started from command prompt (not as service) and leave that prompt open. Last characteristic, explicitly leads to have at least on opened RDP session ... and the worst of all leads to impossibility that this script is automatically started on server restart.

Another big problem in finding solution for mentioned problem is that this .cmd is calling pure java what makes all thing even harder to automatize. While trying find a solution I have tried several solutions (Java wrapper, Java service etc.) but they all was or unstable or missing some important features or not free.

The solution

Thanks to my colleague Joso Mrša who had similar problem with nginx on Windows, I was pointed to project called Windows Service Wrapper. With Windows Service Wrapper we have a way of properly starting and stopping OBI oc4j part of OBI.
  1. First you’ll need to download the latest exe, "winsw-1.9-bin.exe" at the time of writing, and rename it to something else. In mine case new name is myapp.exe. By renaming original file you are enabling future upgrades without having any other problem or configurations-just rename new .exe to myapp.exe and this overwrite old version with new one.
  2. In the same dir where myapp.exe is placed, create myapp.xml and put next content into it
    
      OBIcmd 
      OBIcmd 
      OBI oc4j start through service 
      C:\OracleBI\oc4j_bi\bin\oc4j.cmd 
      C:\OracleBI\ 
      roll 
       
        -start 
        -stop 
      
    
    
    This script assume that OBI_HOME is installed in default "C:\OracleBI" directory
  3. Execute the command
    myapp.exe install
    
    With this step you'll find new Windows service OBIcmd in list of services.
  4. Change it's start type to manual
  5. Change all other startup Oracle BI services to manual (if they were automatic), because they'll be started from other script
  6. If you do not have, create start_OBI.bat script as:
    @ECHO Order of starting resources:
    @ECHO    1. Oracle Java Host
    @ECHO    2. OC4J
    @ECHO    3. Oracle BI Server
    @ECHO    4. Oracle Presentation Services
    @ECHO    5. Oracle BI Scheduler (do not start it in my case, add missing call of service)
    
    NET START "Oracle BI Java Host"
    NET START "Obicmd"
    NET START "Oracle BI Server"
    NET START "Oracle BI Presentation Server"
    
    As you see in highlighted line, this is classic startup OBI Windows script where oc3j call is replaced with Windows Service Wrapper call.
  7. When you run script on stopped OBI and result is like
    Then your OBI has not been properly started.
    Notice, how OBIcmd is not started as well as Oracle BI EE OC4J
  8. . In most cases it is uncleanly shutdown previous version of OC4J which hang on port. Error in log is
    Error starting ORMI server port Address already in use: JVM_Bind.
  9. Create through Windows scheduler, new schedule which will call previously mentioned start_OBI.bat script on server startup
    Uncheck option "require user to be logged" which ensure that this script will run regardless user is logged or not.

The end

It is very convenient to create stop_OBI.bat on a similar way like start one. This script should be used for instant restart actions.
Hope this helps someone.

Cheers!

No comments:

Post a Comment