Thursday, February 21, 2013

How many schemas can be used in an ODI interface ?

This question might sound strange, but my experience with people has led to explaining this fact in my blog.
So, tables are contained within a schema, for convenience sake, lets assume everything is done in Oracle SQL. I have two schemas as Source : Source1 and Source2, one staging : Staging and a target schema Target.

Case 1: Can I use tables in Source1 and Source2 joined by some clause as Sources ?
Yes, if tables are joined in source, it doesnt matter what schemas they belong to.
Staging can be set as target or defined as something other than target

Case 2: I need to use table1 from Source1 as source, I will need table2 from source2 while looking up a certain value while inserting in target but, essentially table1 and table2 wont be joined by any logical condition and Staging area is different from target
Now, things get a little tricky here.
Any table X that is referenced in ODI interface should satisfy one of the criteria to work successfully
1. It should be used as a source
2. If  X is used along with another table as Source, X and the other table should be joined
3. If X is not present in Source but needed for some reasons, the staging schema should be the same as the schema to which X belongs, and table X needs to be explicitly called with its schema name (e.g. Select * from StagingSchema.TableX ) and this mapping must be executed on staging area.
(In the next article, I will be explaining the use of 'odiRef.getObjectName' for this purpose)

Case 3: Source1 used as source, Source2 needed but not joined and Staging area same as target.
In this case, the staging schema is that of target i.e. Target
A workaround for this case is to bring the contents to Source2.Table2 into Target.TempSource2 (replicate the table of Source2 schema in Target schema and use it) But there is additional dependency of creating a table and pulling data into another one, which adds to the confusion

So, the moral of the story is : Whenever doing integrations make sure that Source Schemas are organized in such a way that they can be safely used without conflict, or, in other words, the datapoints must be designed smartly.

Cheers!
 

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 !!!