Wednesday, December 5, 2012

Running batch scripts in ODI

Okay, one of the most basic questions in ODI.
How do I convert a package into a batch script so that it can be scheduled using task scheduler, or run it without opening ODI window at all ??

Packages can be converted into a scenario and scenarios can be executed through command prompt using the startscen.bat script. It is located in ODI_HOME\oracledi\agent\bin folder.
Now, if you just type startscen.bat and hit enter in the command prompt, a full description will be displayed (just like the 'man' command in linux) . Read the instructions properly, the simplest one requires three parameters : The Scenario name, Version, Context
So it would look like : C:\......\bin\startscen.bat Scenario_name version_number Context

The only confusion is when you convert the package into a scenario it suffixes it with the version, e.g. Package named 'Trial' will be displayed as 'Trial version 001'.
When you run the startscen.bat make sure you dont add the suffixes, as an example, when you run the Trial version 001 using cmd prompt, your three mandatory parameters would be
startscen.bat Trial 001 Global

You can go to the operator window and check if it has worked successfully.

Good luck !!!

Changing Java home path in ODI

Sometimes it happens that you have to use a different Java location for ODI to work. This was more prominent in the initial releases of ODI 11g where if the system was 64 bit, ODI installer needed a 32 bit Java for the installation to run, then after the installation was complete it would need 64 bit java version to get it working.
The problem has been resolved now and you dont have to worry about Java version.
But incase you want to change the path, you should modify the odi.conf file, its available in the following folder
ODI_HOME\oracledi\client\odi\bin\odi.conf

Check the last line in odi.conf file,
SetJavaHome C:\oracle\Middleware\Oracle_ODI_EE\jrockit

You can specify the new path here ...

Enjoy !!!