Saturday 12 November 2011

ODI Notes

ODI agent is an intriguing concept to those coming from other ETL tool backgrounds (like INFA).

ODI agent infrastructure is installed in ODI_HOME/oracledi/agent

If you go to ODI_HOME/oracledi/agent/bin/  you can see lots of command line scripts.

There are two types of agents :

1. Logical Agent:
2. Physical Agent

Just like the mapping between Logical to Physical Schema, the mapping between Logical and Physical agent is specified by specifying the Context.

A logical agent is created in Logical Architecture, by right clicking on the Agents and entering the Agent Name, followed by choosing the corresponding Physical Agent  in the Context.

Physical Agent

When creating a Physical Agent in the Physical Architecture in Topology, specify the following:

1. Name of the physical agent used in java gui. Avoid using name as Internal as ODI uses internal agent with name Internal while running sessions and reserves the Internal agent name.
2. Host- name of the network of ip address of the machine on which agent will be launched.
3. Port- port at which agent listens to. default port is 20910
4. WebApplicationContext- this is the name of the web application corresponding to the java ee agent deployed on an application server. For Standalone agents this should be set as oraclediagent.
5. Protocal: to be used for agent connection. Valid values are http, https
6. Maximum number of sessions supported by this agent.
7. Go to Load Balancing tab if you want to setup load balancing and check the check box Linked to specify the agent to which this agent can delegate executions.









Let's take a look at ODI standalone agent. During installation if you've chosen to install Standalone Agent but have skipped Repository creation wizard then ODI agent will be installed but not configured.

1. StandAlone Agent
2. JAVA EE Agent

Configuring StandAlone Agent: If you've chosen to install StandAlone Agent during installation, various command line scripts will be available at ODI_HOME\oracledi\agent\bin

Following file contains the parameters to be used(during start up) by StandAlone agent.

ODI_HOME\oracledi\agent\bin\odiparams.bat  (odiparams.sh on linux) :  stores parameters for starting oracle data integrator modules.

some of the variables that are stored in this file are:


REM #
REM # Repository Connection Information
REM #
set ODI_MASTER_DRIVER=oracle.jdbc.OracleDriver
set ODI_MASTER_URL=jdbc:oracle:thin:@localhost:1521:xe
set ODI_MASTER_USER=USER_NAME
set ODI_MASTER_ENCODED_PASS=gxfpqkz074jeaCpL4XSEFzxoj8E0p

REM #
REM # User credentials for agent startup program
REM #
set ODI_SUPERVISOR=SUPERVISOR
set ODI_SUPERVISOR_ENCODED_PASS=fJya.vR5kvNcu9TtV,jVZEt

REM #
REM # User credentials for ODI tools
REM #
set ODI_USER=%ODI_SUPERVISOR%
set ODI_ENCODED_PASS=%ODI_SUPERVISOR_ENCODED_PASS%

REM #
REM # Work Repository Name
REM #
set ODI_SECU_WORK_REP=WORKREP

REM #
REM # Connection retry parameters
REM #
set ODI_CONNECTION_RETRY_COUNT=0
set ODI_CONNECTION_RETRY_DELAY=7000

REM #
REM # Java virtual machine
REM # set ODI_JAVA_HOME=%JAVA_HOME%

set ODI_JAVA_HOME=c:\JAVA\

REM #
REM # Other Parameters
REM #
set ODI_INIT_HEAP=32m
set ODI_MAX_HEAP=256m
set ODI_JMX_PROTOCOL=rmi

REM #
REM # Additional Java Options
REM #
set ODI_ADDITIONAL_JAVA_OPTIONS=

REM # Windows 95,98, Me users only: Any package files added to the /drivers
REM # or /lib/scripting directory should be manually declared in the
REM # ODI_ADDITIONAL_CLASSPATH variable
set ODI_ADDITIONAL_CLASSPATH=


REM # DO NOT EDIT BELOW THIS LINE !
REM # ----------------------------------------------------------------------------


note the supervisor password must be encoded using command(encode.bat located at same location as odiparams.bat):

encode <password>

Procedure Immediate Stop Error:

1. When you try to stop a procedure following error occurs:

ODI-1269: Session ODIPASO (290001) could not be stopped by Agent Internal: session is being run by another Agent with the same name
2. Login to the ODI repository with sys/system credentials:

select * from v$session where schemaname in ('your_Master_Schema_name', 'your_Work_Schema_name')

You will get the SID and Serial# from above script.

alter system kill session 'SID,Serial#'

be careful while running this on a shared environment. you may inadvertently kill some other session.


How To Use Custom Java Code (Custom jar files) in ODI



Adding custom libraries in odi see here:

http://docs.oracle.com/cd/E23943_01/integrate.1111/e12643/appendix_c.htm#CIHECCEC

Here is the excerpt:

To use external libraries, do one of the following:
  • Copy the custom libraries to the userlib folder. This folder is located:
    • On Windows operating systems:
      %APPDATA%/odi/oracledi/userlib
    • On UNIX operating systems:
      ~/.odi/oracledi/userlib
  • Add the custom libraries to the additional_path.txt file. This file is located in the userlib folder and has the following content:
    ; Additional paths file
    ; You can add here paths to additional libraries
    ; Examples:
    ;       C:\ java\libs\myjar.jar
    ;       C:\ java\libs\myzip.zip
    ;       C:\java\libs\*.jar will add all jars contained in the C:\java\libs\ directory
    ;       C:\java\libs\**\*.jar will add all jars contained in the C:\java\libs\ directory and subdirectories

basically add the path where you've kept custom libraries(axis2 , wss4j jars,  RN client bindings code (exported as JAR from Eclipse  see link: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-33.htm ,
just select the packages in Eclipse  and export Java->Jar)) to C:\Users\<username>\AppData\Roaming\odi\oracledi\userlib\additional_path.txt