Gurcan Orhan's Oracle Data Integrator Blog

18.02.13

Adding Variabled HINTS in ODI

As in my previous post I have described how to implement HINTS per interface. It is a little bit tricky because HINTS are stored in development “ODI interfaces” and scenario of the interface must be regenerated when a HINT is changed and completely in developers’ hands.

I have thought about it and found a way to let dba’s change HINTS by updating a parameter table for each interfaces’/procedures’ each step. Once your dba updates/inserts the desired row (per SQL statement for each Knowledge Module or ODI Procedure) and commit the record it is been executed in the next execution of that interface or procedure.

My colleague, Fuat, prepared the necessary development to me and after reviewing the code, I want to share it with you. He blogged the same stuff, it is better for you to check his blog post from here.

1. Create a database table to store HINTS in text format;

Adding Variabled HINT #1 - Create HINTs table

  • INTERFACE_NAME : Name of the Interface that will be queried to get the HINT.
  • INTERFACE_KM : Name of the Knowledge Module that Interface is using (IKM or LKM).
  • KM_STEP_NAME : Name of the step in Knowledge Module which will use the HINT.
  • KM_STEP_ORDER : Order of the step of Knowledge Module.
  • STEP_HINT_NAME : Name of the step of the Knowledge Module. This helps dba which step is sent to database.
  • STEP_HINT_ORDER : There might be more than 1 hint per step of Knowledge Module, this column shows the order of HINT.
  • HINT_VALUE : Exact value of HINT to be added into SQL Statement. This value should contain /*+ and */.

2. Now it is time to edit Knowledge Module and selecting HINTS into ODI Variables and use them.

2.1. Add a step for the first line of Knowledge Module. You can name this step as Get Hints.

Adding Variabled HINT #1 - Getting variabled HINTS from db to ODI Variables

Remember that all the HINTS to use in this Knowledge Module would be passed into #Hint_n variables for future use. Technology of “Command on Target” is Java BeanShell and “Command on Source” is Oracle. We already know which KM we are using, Step Names with the variable names and the last filter should be applied is Interface name which can be determined with the function <%= snpRef.getStep(“STEP_NAME”) %>. All the HINTS for this Knowledge Module are in variables now. It is time to use them.

2.2. In the below picture, it is showing how variabled HINTs are used. Syntax should be as “<@=HINT_NAME@>” where HINT_NAME should be same with the variable declared on the Knowledge Module step on the “Command on Target” section.

Adding Var HINT #3 - Using Variable HINTs in KM Steps

3. Here is how this method looks like in the operator (I know it is not so fancy but you need to trust ODI).

Adding Var HINT #4 - Operator Log of GetHints

4. And the last step, adding variabled HINTS into SQL Statements.

Adding Var HINT #5 - HINTS in SQL Statemets

Limitations;

* You cannot view HINTs session values within Operator logs. But you may insert the value of the HINT into a log table for each value per Interface for previous working values. All you have to do is adding a step in your Knowledge Module/ODI Procedure to insert the value of HINTS used.

About these ads

2 Comments »

  1. The idea of creating the INTERFACE_HINTS table is very good. Liked the logic.

    Comment by Atul — 19.02.13 @ 07:41 | Reply

    • I’m glad you like it Atul. I hope you can use it somewhere in your environment. :-)

      Comment by gurcanorhan — 19.02.13 @ 07:50 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 554 other followers

%d bloggers like this: