You are on page 1of 21

Oracle Data Integrator 11g Bootcamp

Lesson 9 : Knowledge Modules

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Agenda
Understand the role and composition of Knowledge Modules
Review the elements within a Knowledge Module
Review the ODI substitution language
See the steps to create a new Knowledge Module
Understand the role of KM options
Create a new Knowledge Module

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

What are Knowledge Modules?


Sequences of commands used to carry out a data integration task
Combination of templated code and substitution variables
Can be written in any language that an agent can execute
Categorized into several types, for integration, loading, reversing, etc.

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

What Makes a Good Candidate for a Knowledge Module?


Sequences of steps that are repeated commonly, although some steps may be
optional
For each step, identification of the variable parts vs. non-variable parts
For a SELECT statement, the body of the statement stays the same, but the
columns and predicate can vary
For a KM to be re-usable, make sure that when it is written it is not tied to a
particular source system
In cases of Bulk Loading & Extraction KM needs to be tied to a source or target
system

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

What Goes in a Knowledge Module?


Statement bodies and substitution API
Column names, mapping expressions, etc. do not belong in a module
Column references are allowed if used for administration, control etc
Command line calls like SQL*Loader , SQL Server BCP utility, etc
External calls like ftp, scp, etc. can be included

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Categories of Knowledge Module


Knowledge Modules for interfaces
LKM Load Knowledge Modules : extract from source to staging area
IKM Integration Knowledge Modules : populate target datastore from staging
Knowledge Modules for models
CKM Check Knowledge Modules : checks models against constraints, rules
RKM Reverse Engineering Knowledge Modules : extract data dictionary
JKM Journalizing Knowledge Modules : for change data capture
SKM Service Knowledge Modules : publish datastore as a web service

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Knowledge Modules within the Project


KMs copies are held in the Project panel in the Designer navigator
Import into the project the ones you need
Start with basic SQL and file KMs
Then bring-in technology-specific ones
as needed

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Knowledge Module Editor


Right-click on a Knowledge Module and select Open
View description and limitations
Set options
View and edit detailed steps
for the integration task

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Creating a New Knowledge Module : Overview


Most projects involve creating or amending knowledge modules
To fine-tune an existing one to better suit your needs
To implement custom integration tasks required by your organization
Use a combination of your preferred language, plus ODI substitution variables
Define options to allow user control over specific usages of the KM
Provide documentation to describe limitations and purpose

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Creating a Knowledge Module Step 1 : Create Module


Right-click on KM category in Project panel and select New (Module Type)

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Creating a Knowledge Module Step 2 : Name and Description


Specify name for module within Module editor
Provide description of functionality

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Creating a Knowledge Module Step 3 : Add Options


Right-click on module within Project panel and select New Option
Truncate, Drop Indexes, Analyze Table, etc.
Add details for the option: default value, option type, etc.

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Creating a Knowledge Module Step 4 : Add Step Details - I


Switch to the Details tab in the KM editor
Add the details for each step using the plus button
Set conditional execution based on option values

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Creating a Knowledge Module Step 4 : Add Step Details - II


Specify a Name for the step
Set the Log Counter to capture the audits
Set the Log Level between 0 (no logging) to 5 (detailed logging)
Check the option of Ignore Errors, if processing needs to continue on failure of
Step

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Creating a Knowledge Module Step 4 : Add Step Details - III


Select the Command on Target or Command on Source tab and specify the code
to be executed
Set a common Transaction for updates or inserts in your KM
Use Commit option to control commit within a KM
Write the code in Command tab

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Creating a Knowledge Module : ODI Substitution API


Various Java Methods provided by ODI to substitute metadata
Statement structure part of KM
Metadata and statement structure generate code at runtime to execute
create table
<%=odiRef.getTable("L", "INT_NAME", "A")%>
(
<%=odiRef.getColList("", "[COL_NAME]\t[DEST_WRI_DT] " +
odiRef.getInfo("DEST_DDL_NULL"), ",\n\t", "", "INS or UPD")
%>
)

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Creating a Knowledge Module : ODI Substitution API


<% %> tags - Substituted at first pass, used by ODI Substitution API
<? ?> tags - Substituted at second pass, can be used to modify or generate
metadata
Supports Java and Java Bean Shell programing language
<@ @> tags - Substituted at runtime

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Creating a Knowledge Module Step 5 : Review Final KM


Review final KM in Module editor
Use in project, or export and use in other projects

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Hands-On Labs
Lab 9 : Knowledge Modules

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Summary
Knowledge modules provide the technical integration steps within an interface
Use a combination of executable code plus substitution variables
Allows best-practice use of native system functionality
Categorized into six types
Existing KMs can be amended, new ones written
In this session, we have looked at KMs in more detail, and created a new one

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

Oracle Data Integrator 11g Bootcamp


Lesson 9 : Knowledge Modules

T : +44 (0) 8446 697 995 or (888) 631 1410 (USA) E : enquiries@rittmanmead.com W: www.rittmanmead.com

You might also like