0% found this document useful (0 votes)
240 views

Odi Dev Concepts

This document provides steps to create and connect to Oracle Data Integrator (ODI) Master and Work repositories. It outlines verifying prerequisites, connecting to an Oracle 11g database, creating database schemas for the repositories, generating the repositories using ODI Studio, and connecting to them. The second half describes creating an ODI project and interface to export a flat file to a database table, including importing data, transforming it, and writing it to the target.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
240 views

Odi Dev Concepts

This document provides steps to create and connect to Oracle Data Integrator (ODI) Master and Work repositories. It outlines verifying prerequisites, connecting to an Oracle 11g database, creating database schemas for the repositories, generating the repositories using ODI Studio, and connecting to them. The second half describes creating an ODI project and interface to export a flat file to a database table, including importing data, transforming it, and writing it to the target.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 154

1) Creating and Connecting to ODI Master and Work Repositories:

Overview

The first steps to setting up Oracle Data Integrator are to create the Master repository, connect to the Master
repository, create the Work repository, and then connect to the Work repository. This OBE provides a step-by-
step walkthrough of the process of creating and connecting to the ODI Master Repository and the ODI Work
Repository.

Note: The steps to create and connect to the master and work repositories are also outlined in the ODI 11g
Installation Guide.

Scenario

Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for
performing database management and integration tasks on the various resources within the organization. In
particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects
(such as exporting a relational table to a flat file), she needs to create the new Master repository and Work
repository.

Software and Hardware Requirements

The following is a list of software requirements:

 The system should include the following installed products:


o Oracle Database 11g
o Oracle Data Integrator 11gR1

If not done before, start the services and components for Oracle Database 11g

Prerequisites

Before you start the tasks, make sure that your system environment meets the following requirements:

1. Have installed Oracle Database 11g. If not done before, start the services and components for Oracle Database 11g
2. Have installed Oracle Data Integrator 11gR1

Creating and Connecting to ODI Master Repository


1. Start the SQL Developer by selecting Start > Programs > Oracle-OraDb11g_home1 > Application Development >
SQL Developer. When SQL Developer started, close the Logging Page – Log tab.

2 . In SQL Developer, create a new connection.


3. Name this new connection: Administrator. Enter SYSTEM for Username. Enter oracle1 for Password. For SID,
enter: ORCL. Clisk Test, and then click Connect. Click “+” to expand connection Administrator.
4. You have to create the RDBMS schema/user (Oracle 11g) for the Master repository. The schemas can be created by
executing the following SQL commands:

create user <MY_SCHEMA> identified by <MY_PASS>


default tablespace <MY_TBS> temporary tablespace <MY_TEMP>;
grant connect, resource to <MY_SCHEMA>;

Where:
<MY_SCHEMA> corresponds to the name of the schema that you want to create
<MY_PASS> corresponds to the password that you gave
<MY_TBS> corresponds to the Oracle tablespace where the data will be stored
<MY_TEMP> corresponds to the temporary default tablespace

To create the user snpm1 for master repository, enter the following command. Click Execute statement icon .
create user snpm1 identified by oracle1
default tablespace users temporary tablespace temp;

Note: In this command, oracle1 is the value of password to connect to user snpm1.
5. Grant connect privileges to the newly created user by executing the SQL command provided below. Expand Other
Users node to verify that the user snpm1 was successfully created.

grant connect, resource to snpm1;

6. In the next few steps you create the ODI Master repository. Start Oracle Data Integrator: Start > Programs > Oracle
ODI 11g-Home> Oracle Data Integrator > ODI Studio

7. Open the New Gallery by choosing File > New. In the New Gallery, in the Categories tree, select ODI. Select from the
Items list the Master Repository Creation Wizard. Click OK. The Master Repository Creation Wizard appears.
8 . Open the New Gallery by choosing File > New. In the New Gallery, in the Categories tree, select ODI. Select from the
Items list the Master Repository Creation Wizard. Click OK. The Master Repository Creation Wizard appears.

9 . In the Master Repository Creation Wizard, select the browse icon of the JDBC Driver and then select Oracle JDBC
Driver. Click OK. Edit the JDBC URL to read:
jdbc:oracle:thin: localhost:1521:orcl
Enter the User as snpm1 and the Password as oracle1 . Click the Test Connection button and verify successful
connection. Click OK. Click Next on the Master Repository Creation Wizard screen.
10 . In the Authentication window, enter Supervisor Password as SUNOPSIS. Enter SUNOPSIS again to confirm the
password. Click Next.

Note: User names and passwords are case-sensitive in ODI.


11 . In the Password Storage window, select Internal password Storage, and then click Finish. When Master Repository is
successfully created, you will see the Oracle Data Integrator Information message. Click OK. The ODI Master
repository is now created.
12 . You connect to the ODI Master repository by creating a new ODI Master Login. Open the New Gallery by choosing
File > New. In the New Gallery, in the Categories tree, select ODI. From the Items list select Create a New ODI
Repository login.
13 . Configure Repository Connections with the parameters from the tables provided below. To enter the JDBC URL, click
the button next to JDBC URL field and select jdbc:oracle:thin:@<host>:<port>:<sid> as shown in the screenshot,
then edit the URL. Select Master Repository only button. Click Test button. Verify successful connection and click
OK. Click OK to save the connection.

Oracle Data Integrator Connection


Parameter Value
Login Name Master Repository
User SUPERVISOR
Password SUNOPSIS
Database Connection (Master Repository)
Parameter Value
User snpm1
Password oracle1
Driver List Oracle JDBC Driver
Driver Name oracle.jdbc.OracleDriver
Url jdbc:oracle:thin:@localhost:1521:orcl
Note: Do not copy and paste in the JDBC URL field. This may cause problems with entering a valid URL string.
Instead, open the drop-down menu and select the correct driver from the list. Type the correct URL in the URL field.
14 . Click Connect to Repository. Select the newly created repository connection Master Repository from the drop-down
list. ClickOK. The ODI Topology Manager starts. You are now successfully logged in to the ODI Topology Manager.
Creating and Connecting to ODI Work Repository
1. tIf not opened, open SQL Developer. Create the schema/user snpw1 for Work repository by executing the following
SQL command:

create user snpw1 identified by oracle1


default tablespace users temporary tablespace temp;
2. Grant connect privileges to the newly created user by executing the SQL command
provided below. Verify that user snpw1 was successfully created.
Note: You may need to select Other users node and click Refresh icon.
grant connect, resource to snpw1;

3. Now that you created the RDBMS schema/user, use ODI Topology Navigator to create the ODI Work repository. In
ODI, click the Topology Navigator tab and then click to the Repositories panel. Right-click the Work Repositories
node and select New Work Repository. The Create Work Repository Wizard opens.

4. In the screen that follows, enter the parameters shown in the following table. Click the Test button. Verify successful
connection and click OK. Click Next.

Value
Parameter
Technology Oracle
Driver Name oracle.jdbc.driver.OracleDriver
JDBC Url jdbc:oracle:thin:@localhost:1521:orcl
User snpw1
Password oracle1
1 . In the Specify Work Repository properties set the ID to “1”. Set the Name to WORKREP1. Enter Password as
SUNOPSIS. For Work Repository Type, leave Development. Click Finish.
1 . In the Create Work Repository Login window, click Yes. Enter the Login name: WORKREP1 as shown on the
screenshot. Click OK. Verify that the newly created Work repository is now in the work repositories tree view.
1 . Now you disconnect from the Master repository and connect to the Work repository. Click ODI menu and select
Disconnect "Master Repository".

1 . Click Connct to Repository. Select “WORKREP1” from the LoginName drop-down list. Enter Password: SUNOPSIS.
Click OK. Click the Designer tab. The following ODI Designer screen appears.

You have now successfully created and connected to the ODI Work repository.
Summary

In this tutorial, you have learned how to:

 Verify the Prerequisites


 Connect to the RDBMS (Oracle 11g )
 Create the RDBMS Schema/User (11g) for the Master Repository
 Create the ODI Master Repository
 Connect to the ODI Master Repository
 Create the RDBMS Schema/User (Oracle 11g) for the Work Repository
 Create the ODI Work Repository
 Connect to the ODI Work Repository
2) Creating an ODI Project and Interface: Exporting a Flat File to a RDBMS Table

Overview

A common task that is performed using ODI is to export data from a flat file and load this data into RDBMS table.
This tutorial walks you through the steps that are needed to create a project and an interface that will import a file
to a staging area, perform some minor transformations, and then write the data to a table. You also execute the
interface and verify the execution using ODI Operator.

Scenario

Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for
performing database management and integration tasks on various resources within the organization. In
particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects,
Linda created the new Master repository and Work repository. Now Linda needs to create a project and an
interface to export data from a source flat file, perform transformations, and load this data into RDMBS table.

Software and Hardware Requirements

The following is a list of software requirements:

 The system should include the following installed products:


o Oracle Database 11g
o Oracle Data Integrator 11gR1
 If not done before, start the services and components for Oracle Database 11g

Prerequisites

Before you start the tasks, make sure that your system environment meets the following requirements:

1. Have installed Oracle Database 11g. If not done before, start the services and components for Oracle Database
11g
2. Have installed Oracle Data Integrator 11gR1
3. Before attempting this OBE, you should have successfully completed the following OBEs:

ODI11g: Creating and Connecting to ODI Master and Work Repositories.


ODI11g: Creating an ODI Project and Interface : Exporting a Flat File to a Flat File

To access these OBEs, click HERE.

Creating a New Project with Oracle Data Integrator

To create a new project within Oracle Data Integrator, perform the following steps:

1. Start ODI Designer: Start > Programs > Oracle > Oracle Data Integrator > ODI Studio . Select WORKREP1 from
the Login Name drop-down list if not already selected. Enter SUPERVISOR in the User field and SUNOPSIS in the
Password field. Click OK to login.
2.
In the designer tab, click the Projects tab, click New Project icon , and then click New Project.

3. On the screen that appears, set the Name of the project to ODIexp_FT_RT in the Name field. The Code field is filled
automatically. Click Save icon . The newly created ODIexp_FT_RT project now appears in the Projects tree
view. You have now successfully added a new ODI project.
4 . You export a flat file directly to a relational table target. The knowledge modules required for this are LKM File to
SQL and IKM SQL Incremental Update. To import the KMs, expand the Project tab in the left panel, right-click the
Knowledge Modules folder and select Import Knowledge Modules.

Note: In this example, the generic SQL KMs are used. However, specific KMs for the RDBMS technology can be
used as well.
5 . On the screen that follows,in the File Name, navigate to xml-reference directory as shown in the following
screenshot. Click Open.The files to import should appear in the Import Knowledge Modules window. Press and
hold the CTRL key to select IKM SQL to Incremental Update and LKM File to SQL. Click OK.
6. On Import Report window, click Close. Expand the Loading (LKM) and Integration (IKM) folders, and view each
imported KM in the tree view as shown below.
Creating RDBMS Schema for ODI Target Datastore

You need to create a schema to host the ODI RDBMS target datastore.

Note: You created schemas for the flat file source model in the OBE: "Creating an ODI Project and Interface:
Exporting a Flat File to a Flat File".

Note: If you completed the OBE " Creating an ODI Project and Interface: Exporting an RDBMS Table to a Flat
File" earlier, you should already have ODI_STAGE schema created. In this case, you can skip Step1 and Step 2.

To create a new RDBMS schema for the ODI datastore, perform the following steps:

1. Start SQL Developer. You will create the new schema/user by executing the following SQL commands:

create user ODI_STAGE identified by ODI_STAGE

default tablespace users temporary tablespace temp;

grant connect, resource, create trigger, create view to ODI_STAGE;


2. In SQL Developer create new connection called ODI_STAGE. Enter User name as ODI_STAGE with password
ODI_STAGE. For SID enter ORCL. Click Test to verify connection, and then click Connect.

3. Create your target table by executing the SQL commands provided below. Expand connection ODI_STAGE >
Tables > TRG_SALES_PERSON and verify that the table is created successfully.

Note: You may find these commands in the text file frovided with this OBE. To access this file, click HERE.

CREATE table "TRG_SALES_PERSON"(

"SALES_PERSON_ID" NUMBER(8,0) NOT NULL,

"FIRST_NAME" VARCHAR2(80),

"LAST_NAME" VARCHAR2(80),
"DATE_HIRED" VARCHAR2(80),

"DATE_UPDATED" DATE NOT NULL,

constraint "TRG_SALES_PERSON_PK" primary key("SALES_PERSON_ID")

Creating a New ODI Target Dataserver and the Physical Schema

Note: Skip this section, if you completed the OBE " Creating an ODI Project and Interface: Exporting RDBMS
Table to a Flat File" earlier.

After you created the new database target datastore, you need to create a new ODI target data server and the
Physical schema. To create the ODI target data server and physical schema, perform the following steps:

1. In ODI, Open ODI Topology Navigator and then select the Physical Architecture tab. Expand Technologies, right-
click Oracle and select New Data Server.
2. In the Data Server: New window, enter the values provided in the table below. Click the JDBC tab.

Value
Parameter
Name ODI_STAGE
Instance/dblink (Data Server) ORCL
User ODI_STAGE
Password ODI_STAGE
3.
Click for JDBC Driver. Select Oracle JDBC Driver. Click OK. Click for JDBC Url, select
jdbc:oracle:thin:@<host>:<port>:<sid>, and then click OK. Edit the Url to read:
jdbc:oracle:thin:@localhost:1521:ORCL for Oracle Database.
Note: Do not copy and paste in the JDBC Url field. This may cause problems with entering a valid URL string.
4. Click Test Connection. In the window that opens, click Yes to save your data. In the Information window, click OK.
Click Test to verify successful connection. Click OK.

5. Click Expand Oracle technology node, right-click ODI_STAGE dataserver, and then select New Physical Schema.
6. In Schema (Schema) and Schema (Work Schema) field enter your ODI_STAGE schema. Click Save button. Close
ODI_STAGE.ODI_STAGE physical schema window. In the Information window, click OK.

7. Open Logical Architecture tab, expand Technologies > Oracle. Right-click Oracle technology and then select New
Logical Schema.
1. Name logical schema ODI_STAGE. In the Global context, connect this logical schema to ODI_STAGE physical
schema as shown below. Click Save button and then close the tabs.

Creating a New ODI Target Model

Create a new ODI target model that will be used within your ODI Interface. To create a new ODI target model,
perform the following steps:

1. Open ODI Designer. Click Models tab and select New Model. On the screen that appears, enter the values
provided in the following table. Click the Reverse Engineer tab.
Value
Parameter
Name Oracle_RDBMS1
Technology Oracle
Logical Schema ODI_STAGE

2. On the Reverse Engineer tab, set the Context to Global . Click Save button and then close Oracle_RDBMS1 tab.

3. In the Models tab, right-click the Oracle_RDBMS1 model. Select Reverse Engineer. To verify that the
TRG_SALES_PERSON datastore is successfully reversed expand the model as shown below.
Creating a New ODI Interface to Perform Flat File to RDBMS Table
Transformation

To create a new ODI Interface to perform flat file to RDBMS table transformation, pefrom the following steps:
1 . In ODI Designer, click the Projects tab. Expand your project Export-FF-RT, and then expand First Folder. Right-click
Interfaces and select New Interface. In Optimization Context field, select Development.

2 . On the screen that follows, enter the interface name as INT-EXP-FF-RT . If selected, deselect the Staging Area
Different From Target check box. Click the Mapping tab.

3 . Click the Models tab to drag the source and target to the diagram. Drag the SRC_SALES_PERSON.txt datastore
from the Flat_File1 model into the Sources container. Drag the TRG_SALES_PERSON datastore from the
Oracle_RDBMS1 model into the Target Datastore container. When Designer asks “Do you want to perform an
Automatic Mapping?” click Yes.
4 . Set the value for the DATE_UPDATED column in Target Datastore to System date. In Target Datastore, select
DATE_UPDATED. In the Implementation tab, enter SYSDATE. Select Staging Area in the Execute on section. Make
sure that Active Mapping checkbox is selected.
5 . Select the FIRST NAME column in Target Datastore and edit the mapping to read: ltrim(SRC.FIRST_NAME) . This
function removes left spaces in the FIRST_NAME column. In the “Execute on” section, select Staging Area. Click
OK. Repeat this step for columns LAST NAME and DATE HIRED. Refer to the mapping implementation provided in
the table below:

Mapping implementation
Column
FIRST NAME Ltrim(SRC.FIRST_NAME)
LAST NAME Ltrim(SRC.LAST_NAME)
DATE HIRED Ltrim(SRC.DATE_HIRED)
6 . Click the Flow tab. Click the SrcSet_0 (FILE GENERIC) datastore . The properties for the source appear below. For
LKM, select LKM File to SQL from the LKM drop-down list if not selected. Now you need to ensure that the temporary
objects created during transformation are deleted. Set the LKM option DELETE_TEMPORARY_OBJECTS to
<Default>: true as shown below.
7 . Click the Target datastore. Select IKM SQL Incremental Update. Set the IKM option Flow_Control to False. Set the
IKM option DELETE_ALL to True. Click Save .
8.
To test your interface, click Execute button . The following screen appears. Retain the defaults and click OK. On
the next screen, click OK.
9 . Open ODIOperator and verify that your interface was executed successfully. In Operator, click Session List tab,

select All Executions, and the then click refresh button . View execution results for interface INT-EXP-FF-RT.

10 . Double-click Step 12 and click the Execution tab. View the number of rows inserted into the target table (16).
11 . Open the Interface tab. Select Mapping tab, right-click Target Datastore - TRG_SALES_PERSON, and then select
Data.. View Data inserted in the target table. Cloae Data Editor. Close tabs.
Summary

In this tutorial, you have learned how to:

 Verify the Prerequisites


 Create a New Project with Oracle Data Integrator
 Create a New ODI Model for the Flat File Source
 Create a New ODI Source Datastore for Use with ODI Interface
 Create a New ODI Model for the RDBMS Target
 Create a New ODI Target Datastore for Use with ODI Interface
 Create a New Interface with Oracle Data Integrator for a flat file to RDBMS table data transformations

3) Creating an ODI Project and Interface: Exporting an RDBMS Table to a Flat File
Overview

A common task that is performed using ODI is to export data from a relational table and load this data into a flat
file. This tutorial walks you through the steps that are needed to create a project and an interface that will export
a relational table to a flat file. You also execute the interface and verify the execution with ODI Operator.

Scenario

Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for
performing database management and integration tasks on various resources within the organization. In
particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects,
Linda created the new Master repository and Work repository. Now Linda needs to create a project and an
interface to export data from a relational table and load this data into a flat file.

Software and Hardware Requirements

The following is a list of software requirements:

 The system should include the following installed products:


o Oracle Database 11g
o Oracle Data Integrator 11gR1
 If not done before, start the services and components for Oracle Database 11g

Prerequisites

Before you start the tasks, make sure that your system environment meets the following requirements:

1. Have installed Oracle Database 11g. If not done before, start the services and components for Oracle Database
11g
2. Have installed Oracle Data Integrator 11gR1
3. Before attempting this OBE, you should have successfully completed the following OBEs:

ODI11g: Creating and Connecting to ODI Master and Work Repositories.


ODI11g: Creating an ODI Project and Interface : Exporting a Flat File to a Flat File.

To access these OBEs, click HERE.

Creating a New Project with Oracle Data Integrator

To create a new project within Oracle Data Integrator, perform the following steps:

1. Start ODI Designer: Start > Programs > Oracle > Oracle Data Integrator > ODI Studio . Select WORKREP1 from
the Login Name drop-down list if not already selected. Enter SUPERVISOR in the User field and SUNOPSIS in the
Password field. Click OK to login.
2.
In the designer tab, click the Projects tab, click New Project icon , and then click New Project.

3. On the screen that appears, set the Name of the project to ODIexp_FT_RT in the Name field. The Code field is filled

automatically. Click Save icon . The newly created ODIexp_FT_RT project now appears in the Projects tree
view. You have now successfully added a new ODI project.
4 . You export a flat file directly to a relational table target. The knowledge modules required for this are LKM File to
SQL and IKM SQL Incremental Update. To import the KMs, expand the Project tab in the left panel, right-click the
Knowledge Modules folder and select Import Knowledge Modules.

Note: In this example, the generic SQL KM is used. However, specific KMs for the RDBMS technology can be used
as well.

5 . On the screen that follows,in the File Name, navigate to xml-reference directory as shown in the following
screenshot. Click Open.The files to import should appear in the Import Knowledge Modules window. Select IKM
SQL to File Append. Click OK.
6. On Import Report window, click Close.
Creating RDBMS Schema for ODI Source Datastore

You need to create a schema to host the ODI source datastore. In these OBEs you use the RDBMS
user/schema ODI_STAGE for the tables used in these examples.

Note: You created the schemas for the flat file target model in the OBE: "Creating an ODI Project and Interface:
Exporting a Flat File to a Flat File".

Note: If you completed the OBE " Creating an ODI Project and Interface: Exporting a Flat File to a RDBMS
Table" earlier, you should already have ODI_STAGE schema created. In this case, you can skip Step1 and Step
2.

To create a new RDBMS schema for the ODI datastore, perform the following steps:

1. Start SQL Developer. You will create the new schema/user by executing the following SQL commands:

create user ODI_STAGE identified by ODI_STAGE

default tablespace users temporary tablespace temp;

grant connect, resource, create trigger, create view to ODI_STAGE;


2. If not done before, in SQL Developer create new connection called ODI_STAGE. Enter User name as ODI_STAGE
with password ODI_STAGE. For SID enter ORCL. Click Test to verify connection, and then click Connect.

3 . Create your source table and populate it with data by executing the SQL commands provided below. Expand
connection ODI_STAGE > Tables > TRG_SALES_PERSON and verify that the table is created successfully.
Note: You may find these commands in the text file frovided with this OBE. To access this file, click HERE.

CREATE table "SRC_SALES_PERSON" (


"SALES_PERSON_ID" NUMBER(8,0) NOT NULL,
"FIRST_NAME" VARCHAR2(80),
"LAST_NAME" VARCHAR2(80),
"DATE_HIRED" VARCHAR2(80),
"DATE_UPDATED" DATE NOT NULL,
constraint "TRG_SALES_PERSON_PK" primary key("SALES_PERSON_ID")
)
/
begin
insert into ODI_STAGE.SRC_SALES_PERSON values
(11,'Andrew','Andersen','22/02/1999',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(12,'John','Galagers','20/04/2000',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(13,'Jeffrey','Jeferson','32422',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(20,'Jennie','Daumesnil','28/02/1988',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(21,'Steve','Barrot','24/09/1992',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(22,'Mary','Carlin','14/03/1995',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(30,'Paul','Moore','36467',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(31,'Paul','Edwood','18/03/2003',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(32,'Megan','Keegan','29/05/2001',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(40,'Rodolph','Bauman','29/05/2000',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(41,'Stanley','Fischer','37233',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(42,'Brian','Schmidt','25/08/1992',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(50,'Anish','Ishimoto','30/01/1992',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(51,'Cynthia','Nagata','28/02/1994',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON values
(52,'William','Kudo','28/03/1993',sysdate);
end
Creating a New ODI Source Dataserver and the Physical Schema

After you created the new database source datastore, you need to create a new ODI sourcet data server and the
Physical schema.

Note: Skip this section, if you completed the OBE " Creating an ODI Project and Interface: Exporting a Flat File
to a RDBMS Table" earlier.

To create the ODI source data server and physical schema, perform the following steps:

1. In ODI, Open ODI Topology Navigator and then select the Physical Architecture tab. Expand Technologies, right-click
Oracle and select New Data Server.
2. In the Data Server: New window, enter the values provided in the table below. Click the JDBC tab.

Value
Parameter
Name ODI_STAGE
Instance/dblink (Data Server) ORCL
User ODI_STAGE
Password ODI_STAGE
3.
Click for JDBC Driver. Select Oracle JDBC Driver. Click OK. Click for JDBC Url, select
jdbc:oracle:thin:@<host>:<port>:<sid>, and then click OK. Edit the Url to read:
jdbc:oracle:thin:@localhost:1521:ORCL for Oracle Database.
Note: Do not copy and paste in the JDBC Url field. This may cause problems with entering a valid URL string.
4 . Click Test Connection. In the window that opens, click Yes to save your data. In the Information window, click OK.
Click Test to verify successful connection. Click OK.

5 . Click Expand Oracle technology node, right-click ODI_STAGE dataserver, and then select New Physical Schema.
6 . In Schema (Schema) and Schema (Work Schema) field enter your ODI_STAGE schema. Click Save button. Close
ODI_STAGE.ODI_STAGE physical schema window. In the Information window, click OK.

7 . Open Logical Architecture tab, expand Technologies > Oracle. Right-click Oracle technology and then select New
Logical Schema.
1 . Name logical schema ODI_STAGE. In the Global context, connect this logical schema to ODI_STAGE physical
schema as shown below. Click Save button and then close the tabs.

Creating a New ODI Source Model

Create a new ODI target model that will be used within your ODI Interface. To create a new ODI target model,
perform the following steps:

1 . Open ODI Designer. Click Models tab and select New Model. On the screen that appears, enter the values provided
in the following table. Click the Reverse Engineer tab.

Value
Parameter
Name Oracle_RDBMS2
Technology Oracle
Logical Schema ODI_STAGE

2 . On the Reverse Engineer tab, set the Context to Global . Click Save button and then close Oracle_RDBMS2 tab.

3 . In the Models tab, right-click the Oracle_RDBMS2 model. Select Reverse Engineer. To verify that the
SRC_SALES_PERSON datastore is successfully reversed expand the model as shown below.
Creating a New ODI Interface to Perform RDBMS table to Flat File
Transformation

To create a new ODI Interface to perform RDBMS table to flat file transformation, pefrom the following steps:

1 . In ODI Designer, click the Projects tab. Expand your project Export-RT-FT, and then expand First Folder. Right-click
Interfaces and select New Interface. In Optimization Context field, select Global.
2 . On the screen that follows, enter the interface name as INT-EXP-RT_FT . For Staging Area select Oracle:
ODI_STAGE. Click Mapping tab.
3 . Click the Models tab to drag the source and target to the diagram. Drag the TRG_SALES_PERSON.txt datastore
from the Flat_File1 model into the Target container. Drag the SRC_SALES_PERSON datastore from the
Oracle_RDBMS2 model into the Source Datastore container. When Designer asks “Do you want to perform an
Automatic Mapping?” click Yes.
4 . Click the Flow tab. Click Target (FILE_GENERIC). The properties for the target appear below. For the IKM, select
IKM SQL to File Append from the IKM drop-down list. Set the IKM options: TRUNCATE to true,
GENERATE_HEADER to false as shown below. Click Save icon .
5.
To test your interface, click Execute button . The following screen appears. Retain the defaults and click OK. On
the next screen, click OK.

6 . Open ODIOperator and verify that your interface was executed successfully. In Operator, click Session List tab,

select All Executions, and the then click refresh button . View execution results for interface INT-EXP-RT-FT.

7 . Double-click Step 2 and click the Execution tab. View the number of rows inserted into the target datastore (15).
Close the tab.
Summary

In this tutorial, you have learned how to:

 Verify the Prerequisites


 Create a New Project with Oracle Data Integrator
 Create a new ODI Source Dta Server and RDBMS Schema
 Create a new ODI Model for the RDBMS Source
 Create a New ODI Source Datastore for Use with ODI Interface
 Use an ODI Target Datastore with ODI Interface
 Create a New Interface with Oracle Data Integrator for RDBMS table to flat file data transformations
4) Creating an ODI Project and Interface: Exporting a Flat File to a Flat File

Overview

A common task that is performed using ODI is to export data from a flat file and load this data into another flat
file. This tutorial walks you through the steps that are needed to create a project and an interface that will import
a file to a staging area, perform some minor transformations, and then write the data to a file. You also execute
the interface and verify the execution using ODI Operator.

Scenario

Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for
performing database management and integration tasks on various resources within the organization. In
particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects,
Linda created the new Master repository and Work repository. Now Linda needs to create a project and an
interface to export data from a flat file, perform transformations, and load this data into another flat file.

Software and Hardware Requirements (Optional)

The following is a list of software requirements:


 The system should include the following installed products:
o Oracle Database 11g
o Oracle Data Integrator 11gR1
 If not done before, start the services and components for Oracle Database 11g

Prerequisites

Before you start the tasks, make sure that your system environment meets the following requirements:

1. Have installed Oracle Database 11g. If not done before, start the services and components for Oracle Database
11g
2. Have installed Oracle Data Integrator 11gR1
3. Before attempting this OBE, you should have successfully completed the following OBE: ODI11g: Creating and
Connecting to ODI Master and Work Repositories. To access this OBE, click HERE.

Creating a New Project with Oracle Data Integrator

To create a new project within Oracle Data Integrator, perform the following steps:

1. Start ODI Designer: Start > Programs > Oracle > Oracle Data Integrator > ODI Studio . Select WORKREP1 from
the Login Name drop-down list if not already selected. Enter SUPERVISOR in the User field and SUNOPSIS in the
Password field. Click OK to login.

2.
In the designer tab, click the Projects tab, click New Project icon , and then click New Project.
3. On the screen that appears, set the Name of the project to ODIexp_RT_RT in the Name field. The Code field is filled
automatically. Click Save icon . The newly created ODIexp_RT_RT project now appears in the Projects tree
view. You have now successfully added a new ODI project.

4 . For this interface, Linda has to import a flat file into the SQL staging area, and then export the file to a different flat
file. The Knowledge Modules (KMs) that are required for this are LKM File to SQL and IKM SQL to File Append.
To import the KMs, click the Project tab in the left panel and expand the Knowledge Modules folder. Right-click
Loading (LKM) and select Import Knowledge Modules.
Note: In this example, the generic SQL KMs are used. However, specific KMs for the RDBMS technology can be
used as well.

5 . On the screen that follows,in the File Name, navigate to xml-reference directory as shown in the following
screenshot. Click Open.The files to import should appear in the Import Knowledge Modules window. Press and
hold the CTRL key to select IKM SQL to File Append and LKM File to SQL. Click OK.
6. On Import Report window, click Close. Expand the Loading (LKM) and Integration (IKM) folders, and view each
imported KM in the tree view as shown below.
Creating a New Physical Schema for the Flat File Model
To create a Physical schema for a new flat file model, perform the following steps:
1 . Click Topology tab. In Topology navigator, click the Physical Architecture tab, select Technologies > File. Right-
click FILE_GENERIC, and then select New Physical Schema.

2. For the Directory (Schema) and Directory (Work Schema) fields, enter the path to the directory, where your input
flat files are located ( C:\Oracle\Middleware\Oracle_ODI1\oracledi\demo\file ). Select Default check box, and then
click Save button. Close editing window for your new physical schema. On the Information window that follows,
click OK. Verify that your new Physical schema was added under the FILE_GENERIC data server in the
Technologies tree view.

3. .Open Logical Architecture, navigate to Technologies > File, right-click File and select New Logical Schema. Enter
the Logical Schema name: FLAT_FILES_SRC, select the your nely created physical schema in Global context as
shown below. Click Save and close the editing windows.
Creating a New ODI Model for the Flat File Source

To create a new model for the flat file target datastore, perform the following steps: .

1. Click the Models tab in the left panel of ODI Designer. Click the Insert Model Folder icon, and then select New
Model Folder. On the screen that appears, set the Name to Files. Click Save icon.
2. Right-click the Files model folder and select New Model. On the screen that appears, enter the values provided in
the following table. Select Reverse Engineer tab.

Parameter Value
Name Flat_File_1
Technology File
Logical Schema FILE_DEMO_SRC
3. On the screen that appears, verify settings and click Save icon to save your model . very that your newly created
model appeared in the tree view under Files node.

Creating a New ODI Source Datastore for use with ODI Interface

To create a new ODI source datastore, perform the following steps:

1. Expand the Flat Files folder, right-click the newly created Flat_File_1 model, and then select New Datastore. On the

screen that appears, set Name to SRC_SALES_PERSON. Click the button next to the Resource Name field.
Select the SRC_SALES_PERSON.txt file and click Open.

Note: In this OBE, you use the sample files that are delivered with the ODI installation.
2. Click the Files tab. Set the File Format to Fixed, and then click the Columns tab.

3 . On the Columns tab, click the Reverse Engineer button. The following screen appears. Click Yes.. The Column
Setup Wizard appears.
4 . Point the cursor, and then click the ruler at the beginning of each column as shown below. The wizard marks each
column.
5 . After the columns are marked, click each column data and set the Name and Datatype for each column. For the
names and data types of each column, refer to the following table. Click OK when you have finished.

Column Name Data Type


C1 SALES_PERSON_ID numeric
C2 FIRST_NAME string
C3 LAST_NAME string
C4 DATE_HIRED string
6 . The columns should now look as follows. Click OK to save the model. Expand Files >Flat_ File1 >
SRC_SALES_PERSON (SRC_SALES_PERSON.txt) > Columns to view your source model. Verify that the
columns were successfully created as shown in the screenshot.
Note: If the columns have not been created, edit the newly created datastore: right-click the SRC_SALES_PERSON
datastore, select Edit, and repeat steps 3, 4, 5, and 6.

7 . In the Flat_File_1 model, right-click SRC_SALES_PERSON datastore, and then select View Data option. Close all
tabs.
Creating a New ODI Target Datastore for use with ODI Interface
To create a new ODI target datastore, perform the following steps:

1. In this OBE, you use the sample files that are delivered with the ODI installation. Browse to the
ODI_HOME\demo\file directory (C:\Oracle\Middleware\Oracle_ODI1\oracledi\demo\file). Make a copy of the
SRC_SALES_PERSON.txt file and name the copy TRG_SALES_PERSON.txt as shown in the example in the
following screenshots.

2. In ODI Designer, right-click the newly created source datastore SRC_SALES_PERSON and select Duplicate. On
the screen that follows, click Yes. The new Copy of SRC_SALES_PERSON.txt appears in the tree view.
3. Right-click the newly created duplicate Copy of SRC_SALES_PERSON.txt and select Edit. On the screen that

appears, set the Name to TRG_SALES_PERSON. Click the button next to the Resource Name field.

Note: The Files tab and Columns tab do not need to be changed because they are duplicated from the source file
4. Select the TRG_SALES_PERSON.txt file and click Open. Click Save icon. The datastores for the source and
target files have now been successfully created in the same model and can be used in an ODI interface. Close
editing tabs.
Creating a New ODI Interface for Flat File to Flat File Transformations

To create a new interface, perform the following steps:

1. In ODI Designer, click the Projects tab. Expand your project ODIexp_RT_RT, and then expand First Folder.
Right-click Interfaces and select Insert Interface.

2. On the screen that follows, enter the interface name as INT_exp_FT_FT. Select In-Memory Engine:
SUNOPSIS_MEMORY_ENGINE from drop-down list. Click the Mapping tab. If the Help screen appears, click OK.

Note: For this OBE, we will use the Sunopsis Memory Engine as our staging area because we want to perform
some transformations on the imported data.

3. Click the Models tab to drag the source and target to Designer. Expand Files > Flat_File_1 and drag the
SRC_SALES_PERSON datastore from the Files folder into the Sources container. Drag the
TRG_SALES_PERSON.txt datastore from Files into the Target Datastore container. When Designer asks "Do
you want to perform an Automatic Mapping?" click Yes. The Diagram tab should look as follows. Click the Flow
tab.

Note: For the purposes of this tutorial, default mappings are used, although a number transformation can be
performed in the mapping. The mapping should be performed in the staging area.

4. Click the SS_0 (1 - FILE_GENERIC) source datastore. This makes the properties for the source appear below. In
the LKM Selector section, select LKM File to SQL from the LKM drop-down list if not already selected.

5. Click Target (FILE_GENERIC). This makes the properties for the target appear below. For IKM, select IKM SQL to
File Append from the IKM drop-down list if not already selected. Set the IKM options TRUNCATE to True and
GENERATE_HEADER to False as shown below. Click Save icon to save your interface .
6.
To test your interface, click Execute icon . The following screen appears. Retain the defaults and click OK. On
the screen that follows, click OK.
7. To verify that your interface was executed successfully, you need to open ODI Operator. Click the ODI Operator
tab. In ODI Operator, click Hierarchial Sessions. Expand Date > Today > INT_exp_FF_FF > Steps >
INT_exp_FF_FF, and view the execution results for each step. Double-click any step and click the Description
and Execution tabs to see the execution results. Double-click step 6. View the number of rows that are inserted
into the target flat file. Click OK. Close the tabs.
Summary

In this tutorial, you have learned how to:

 Verify the Prerequisites


 Create a New Project with Oracle Data Integrator
 Create a New ODI Model for the Flat File Source
 Create a New ODI Source Datastore for Use with ODI Interface
 Create a New ODI Target Datastore for Use with ODI Interface
 Create a New Interface with Oracle Data Integrator for a flat file to a flat file data transformation
5) Creating an ODI Procedure to Create and Populate RDBMS Table

Overview

A common task that is performed using ODI is to create and populate a relational table. This tutorial walks you
through the steps that are needed to create a project and a procedure that will create and populate a relational
table with data. You also execute the procedure and verify the execution within ODI Operator.

Scenario

Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for
performing database management and integration tasks on the various resources within the organization. In
particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects,
Linda created the new Master repository and Work repository. Now Linda needs to create a project and a
procedure to create a relational table and populate it with data.

Software and Hardware Requirements

The following is a list of software requirements:

 The system should include the following installed products:


o Oracle Database 11g
o Oracle Data Integrator 11gR1
 If not done before, start the services and components for Oracle Database 11g

Prerequisites

Before you start the tasks, make sure that your system environment meets the following requirements:

1. Have installed Oracle Database 11g. If not done before, start the services and components for Oracle Database
11g
2. Have installed Oracle Data Integrator 11gR1
3. Before attempting this OBE, you should have successfully completed the following OBE:

ODI11g: Creating and Connecting to ODI Master and Work Repositories.

To access this OBE, click HERE.

Creating RDBMS Schema for ODI Source Datastore

You need to create a schema to host the RDBMS table. In this OBE, you use the RDBMS user/schema
ODI_STAGE.

Note: You may skip this section if you completed one of the following OBEs:

 ODI11g: Creating an ODI Project and Interface: Exporting a Flat File to a RDBMS Table
 ODI11g: Creating an ODI Project and Interface: Exporting an RDBMS Table to a Flat File

To access these OBEs, click HERE.

To create a new RDBMS schema for the ODI datastore, perform the following steps:

1 . Start SQL Developer. You will create the new schema/user by executing the following SQL commands:

create user ODI_STAGE identified by ODI_STAGE


default tablespace users temporary tablespace temp;

grant connect, resource, create trigger, create view to ODI_STAGE;

2 . If not done before, in SQL Developer create new connection called ODI_STAGE. Enter User name as ODI_STAGE
with password ODI_STAGE. For SID enter ORCL. Click Test to verify connection, and then click Connect.

Creating a New ODI Dataserver, Physical and Logical Schemas for RDBMS
table

Note: You may skip this section if you completed one of the following OBEs:
 Creating an ODI Project and Interface: Exporting a Flat File to a RDBMS Table
 Creating an ODI Project and Interface: Exporting an RDBMS Table to a Flat File

After you created the new database target datastore, you need to create a new ODI target data server and the
Physical schema. To create the ODI target data server and physical schema, perform the following steps:

1. In ODI, Open ODI Topology Navigator and then select the Physical Architecture tab. Expand Technologies, right-
click Oracle and select New Data Server.

2. In the Data Server: New window, enter the values provided in the table below. Click the JDBC tab.

Value
Parameter
Name ODI_STAGE
Instance/dblink (Data Server) ORCL
User ODI_STAGE
Password ODI_STAGE
3.
Click for JDBC Driver. Select Oracle JDBC Driver. Click OK. Click for JDBC Url, select
jdbc:oracle:thin:@<host>:<port>:<sid>, and then click OK. Edit the Url to read:
jdbc:oracle:thin:@localhost:1521:ORCL for Oracle Database.
Note: Do not copy and paste in the JDBC Url field. This may cause problems with entering a valid URL string.
4. Click Test Connection. In the window that opens, click Yes to save your data. In the Information window, click OK.
Click Test to verify successful connection. Click OK.
5. Click Expand Oracle technology node, right-click ODI_STAGE dataserver, and then select New Physical Schema.

6. In Schema (Schema) and Schema (Work Schema) field enter your ODI_STAGE schema. Click Save button. Close
ODI_STAGE.ODI_STAGE physical schema window. In the Information window, click OK.

7. Open Logical Architecture tab, expand Technologies > Oracle. Right-click Oracle technology and then select New
Logical Schema.

1. Name logical schema ODI_STAGE. In the Global context, connect this logical schema to ODI_STAGE physical
schema as shown below. Click Save button and then close the tabs.

Creating a New ODI Project

To create a new project within Oracle Data Integrator, perform the following steps:
1. Start ODI Designer: Start > Programs > Oracle > Oracle Data Integrator > ODI Studio . Select WORKREP1 from
the Login Name drop-down list if not already selected. Enter SUPERVISOR in the User field and SUNOPSIS in the
Password field. Click OK to login.

2.
In the designer tab, click the Projects tab, click New Project icon , and then click New Project.

3. On the screen that appears, set the Name of the project to Procedure-CRT-TBL in the Name field. The Code field is
filled automatically. Click Save icon . The newly created Procedure-CRT-TBL project now appears in the
Projects tree view. You have now successfully added a new ODI project.
Creating ODI Procedure to Create and Populate RDBMS Table

To create a new ODI procedure to create and populate RDBMS table, perform the following steps:

1. In the Projects tab, expand: Procedure-CRT-TBL > First Folder. Right-click Procedures and select New
Procedure.

2. Enter the procedure name as PRD-create-populate-table. Set Target Technology to Oracle. Click the Details tab.

Click the icon to add a step in the procedure.


3. In the Command: New window, enter the parameters of the procedure and the command on target provided below.
You need this command to drop the table in case the table with this name exists. Select the Ignore Errors check
box. Select details tab.

Value
Parameter
Name Drop table
Technology Oracle
Schema ODI_STAGE
DROP table ODI_STAGE.SRC_SALES_PERSON1

DROP table ODI_STAGE.SRC_SALES_PERSON1

Note: You may find this and following commands in the text file frovided with this OBE. To access this file, click
HERE.
4.
Click the icon to add another step in the procedure. In the Command: New window, if not selected, click the
“Command on Target” tab. Enter the parameters of the procedure and the command provided below, and then click
the Details tab.

Value
Parameter
Name Create Table
Technology Oracle
Schema ODI_STAGE

CREATE table "SRC_SALES_PERSON1" (


"SALES_PERSON_ID" NUMBER(8,0) NOT NULL,
"FIRST_NAME" VARCHAR2(80),
"LAST_NAME" VARCHAR2(80),
"DATE_HIRED" VARCHAR2(80),
"DATE_UPDATED" DATE NOT NULL,
constraint "TRG_SALES_PERSON1_PK" primary key("SALES_PERSON_ID")
)
/
5.
Click the icon to enter the step to populate the SRC_SALES_PERSON table. Enter the parameters of the
procedure and the command provided below, and then click the Details tab.

Value
Parameter
Name Populate table
Technology Oracle
Schema ODI_STAGE

begin
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(11,'Andrew','Andersen','22/02/1999',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(12,'John','Galagers','20/04/2000',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(13,'Jeffrey','Jeferson','32422',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(20,'Jennie','Daumesnil','28/02/1988',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(21,'Steve','Barrot','24/09/1992',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(22,'Mary','Carlin','14/03/1995',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(30,'Paul','Moore','36467',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(31,'Paul','Edwood','18/03/2003',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(32,'Megan','Keegan','29/05/2001',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(40,'Rodolph','Bauman','29/05/2000',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(41,'Stanley','Fischer','37233',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(42,'Brian','Schmidt','25/08/1992',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(50,'Anish','Ishimoto','30/01/1992',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(51,'Cynthia','Nagata','28/02/1994',sysdate);
insert into ODI_STAGE.SRC_SALES_PERSON1 values
(52,'William','Kudo','28/03/1993',sysdate);
end

6.
View your newly created commands and click Save to save the procedure. Close the tab.

7. Expand Procedure-CRT-TBL > Procedures, select the newly created procedure PRD-create-populate-table, and
then select Execute. Click OK. Click OK again.

8.
Open ODI Operator. In ODI Operator, click All executions node, click the Refresh icon, find your session, and
verify that your procedure executed successfully.
9. Open the Oracle SQL developer and expand ODI_STAGE connection. Select Tables node and click Refresh button

. Double–click the newly created table SRC_SALES_PERSON1, click Data tab, and verify that your table
SRC_SALES_PERSON1 was successfully created and populated with records as shown below.
Summary

In this tutorial, you have learned how to:

 Verify the Prerequisites


 Create a New Project with Oracle Data Integrator
 Create a New ODI Model for the Flat File Source
 Create a New ODI Source Datastore for Use with ODI Interface
 Create a New ODI Model for the RDBMS Target
 Create a New ODI Target Datastore for Use with ODI Interface
 Create a New Interface with Oracle Data Integrator for a flat file to RDBMS table data transformations
6) Creating an ODI Project: Developing an ODI XML to Database Transformation Using
Interface with ODI Constraint

Overview

Oracle Data Integrator provides the ability to validate data during the load to the target using ODI constraints or
database constraints. When this data is checked against a constraint using the Flow Control, any errors that are
found are not loaded to the target but are loaded to an errors table that is created and managed by ODI. Each
row of this table represents a record that did not pass a constraint, the row also has a message column that
explains why the records were rejected.
This table can be edited within ODI Designer or any other tool that can edit relational tables. However, this is not
always a convenient way for the end user or business user edit the data. This example uses an ODI interface,
alternatively you can build an ODI procedure that will load an XML file with a constraint.

Scenario

Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for
performing database management and integration tasks on various resources within the organization. In
particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects,
Linda created the new Master repository and Work repository. Now Linda needs to create a project and an
interface to export data from a source XML file, perform transformations, and load this data into RDMBS table
using ODI constraints.

Software and Hardware Requirements

The following is a list of software requirements:

 The system should include the following installed products:


o Oracle Database 11g
o Oracle Data Integrator 11gR1
 If not done before, start the services and components for Oracle Database 11g

Prerequisites

Before you start the tasks, make sure that your system environment meets the following requirements:

1. Have installed Oracle Database 11g. If not done before, start the services and components for Oracle Database
11g
2. Have installed Oracle Data Integrator 11gR1
3. Before attempting this OBE, you should have successfully completed the following OBEs:

ODI11g: Creating and Connecting to ODI Master and Work Repositories.


ODI11g: Creating an ODI Project and Interface : Exporting a Flat File to a Flat File

To access these OBEs, click HERE.

Creating a New Project with Oracle Data Integrator

To create a new project within Oracle Data Integrator, perform the following steps:

1. Start ODI Designer: Start > Programs > Oracle > Oracle Data Integrator > ODI Studio . Click Connect to
Repository.
2. Select WORKREP1 from the Login Name drop-down list if not already selected. Enter SUPERVISOR in the User
field and SUNOPSIS in the Password field. Click OK to login. In the Designer tab, click the Projects tab, click New

Project icon , and then select New Project.

3. On the screen that appears, set the Name of the project to ODI_exp_XML-RT in the Name field. The Code field is

filled automatically. Click Save icon . The newly created ODI_exp_XML-RT project now appears in the Projects
tree view. You have now successfully added a new ODI project.
4 . You export an XML file directly to a relational table target. The knowledge modules required for this are LKM File to
SQL and IKM SQL Incremental Update. To import the KMs, expand the Project tab in the left panel, right-click the
Knowledge Modules folder and select Import Knowledge Modules.

Note: In this example, the generic SQL KMs are used. However, specific KMs for the RDBMS technology can be
used as well.
5 . On the screen that follows,in the File Name, navigate to xml-reference directory as shown in the following
screenshot. Click Open.The files to import should appear in the Import Knowledge Modules window. Press and
hold the CTRL key to select CKM SQL, IKM SQL Control Append, and LKM SQL to SQL. Click OK.

Parameter Value
Loading LKM SQL to SQL
Integration IKM SQL Control Append
Check CKM SQL
6. On Import Report window, click Close. Expand the Loading (LKM), Check, and Integration (IKM) folders, and view
each imported KM in the tree view as shown below.
Creating New Data Server and Physical Schema for the XML Source Model

In this section you use the sample XML file GEO_DIM.xml provided with this OBE. Download file DEMO.zip from
HERE, and extract it in your <ODI-HOME> directory. For example:
C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\demo\

To create new Data server and Physical schema for a new XML model, perform the following steps:

1. Click Topology tab. In Topology navigator, click the Physical Architecture tab, select Technologies > XML. Right-
click XML and select New Data Server. Name this data server XML File. Click JDBC tab.
2. In JDBC tab, select driver: com.sunopsis.jdbc.driver.xml.SnpsXmlDriver. Enter the following JDBC URL, click Save

. To verify connection, click Test Connection. Click Test and then click OK.

<ODI_HOME>/demo/xml/GEO_DIM.xml&re=GEOGRAPHY_DIM&ro=false&case_
sens=true
3. Right-click XML File Data server, and select New Physical Schema. For the Directory (Schema) and Directory

(Work Schema) fields, select GEO_D. Click Save . In Information window, click OK.

4. .Open Logical Architecture, navigate to Technologies > XML, right-click XML and select New Logical Schema.
Enter the Logical Schema name: GEO_DIM, select the your nely created physical schema in Global context as

shown below. Click Save and close the editing windows.


Creating RDBMS Schema/User for ODI Target Datastore

You need RDBMS schema/users to host the ODI target datastore.

Note: If you completed the OBE " Creating an ODI Project and Interface: Exporting a Flat File to a RDBMS
Table" earlier, you should already have ODI_STAGE schema created. In this case, you can skip this section.

To create a new RDBMS schema for the ODI target datastore, perform the following steps:

1 . Start SQL Developer. You will create the new schema/user by executing the following SQL commands:

create user ODI_STAGE identified by ODI_STAGE

default tablespace users temporary tablespace temp;

grant connect, resource, create trigger, create view to ODI_STAGE;

Creating a New ODI Target Dataserver and the Physical Schema

Note: Skip this section, if you completed the OBE " Creating an ODI Project and Interface: Exporting RDBMS
Table to a Flat File" earlier.

After you created the new database target datastore, you need to create a new ODI target data server and the
Physical schema. To create the ODI target data server and physical schema, perform the following steps:

1. In ODI, Open ODI Topology Navigator and then select the Physical Architecture tab. Expand Technologies, right-
click Oracle and select New Data Server.
2. In the Data Server: New window, enter the values provided in the table below. Click the JDBC tab.

Value
Parameter
Name ODI_STAGE
Instance/dblink (Data Server) ORCL
User ODI_STAGE
Password ODI_STAGE
3.
Click for JDBC Driver. Select Oracle JDBC Driver. Click OK. Click for JDBC Url, select
jdbc:oracle:thin:@<host>:<port>:<sid>, and then click OK. Edit the Url to read:
jdbc:oracle:thin:@localhost:1521:ORCL for Oracle Database.
Note: Do not copy and paste in the JDBC Url field. This may cause problems with entering a valid URL string.
4. Click Test Connection. In the window that opens, click Yes to save your data. In the Information window, click OK.
Click Test to verify successful connection. Click OK.

5. Click Expand Oracle technology node, right-click ODI_STAGE dataserver, and then select New Physical Schema.
6. In Schema (Schema) and Schema (Work Schema) field enter your ODI_STAGE schema. Click Save button. Close
ODI_STAGE.ODI_STAGE physical schema window. In the Information window, click OK.

7. Open Logical Architecture tab, expand Technologies > Oracle. Right-click Oracle technology and then select New
Logical Schema.
8. Name logical schema ODI_STAGE. In the Global context, connect this logical schema to ODI_STAGE physical
schema as shown below. Click Save button and then close the tabs.

Creating a New ODI Source Model

Create a new ODI source XML model that will be used within your ODI Interface. To create a new ODI source
model, perform the following steps:
1. Open ODI Designer. Click Models tab and select New Model. On the screen that appears, enter the values
provided in the following table. Click the Reverse Engineer tab.

Parameter Value
Name SRC_GEO_DIM_XML
Technology XML
Logical Schema GEO_DIM

2.
On the Reverse Engineer tab, set the Context to Global . Click Save button and then close the tab.

3. In the Models tab, right-click the SCR_GEO_DIM_XML model. Select Reverse Engineer. To verify that the model is
successfully reversed, expand the model as shown below.
Creating a New ODI Target Model

Create a new ODI target model that will be used within your ODI Interface. To create a new ODI target model,
perform the following steps:

1. Open ODI Designer. Click Models tab and select New Model. On the screen that appears, enter the values
provided in the following table. Click the Reverse Engineer tab.
Parameter Value
Name RDBMS_TARGET
Technology Oracle
Logical Schema ODI_STAGE

2. On the Reverse Engineer tab, set the Context to Global . Click Save button and then close the tab.

3. In the Models pane, click "+" to expand the RDBMS_TARGET and SRC_GEO_DIM_XML. Under
SRC_GEO_DIM_XML, right-click the CLIENT datastore and select Duplicate selection . Click Yes to confirm.
4. Drag and drop the new duplicate Copy of CLIENT from the SRC_GEO_DIM_XML model to the RDBMS_TARGET
model. Next, right-click the Copy of CLIENT data store within the RDBMS_Target and click Open. Incase you get

an Object Locking dialog box, click No. Change the name of the datastore to CLIENT and click Save button .
Close the tab.

Note: No physical table has been created on the RDBMS_TARGET. When the interface is run, it will create the
physical table CLIENT.
Setting up ODI Constraint on CLIENT Datastore

During the duplication of the CLIENT data store the constraint for the XML file was also copied. You have to
delete this constraint and set another constraint in CLIENT datastore. To set up the ODI constraint , perform the
following steps:

1. In the Models tab, expand RDBMS_TARGET > CLIENT > Constraints > CITY Copy of CITY_CLIENT. Right-click
CITY_CLIENT CITY and click Delete. Click Yes to confirm.
2. Under RDBMS_TARGET > CLIENT > Constraints right-click and select New Condition.
3.
In the New object window, provide the following values and then click Save .

Parameter Value
Name Age_Constraint
Type Oracle Data Integrator Condition
Where cast(Client.age as numeric) >=21
Message Client must be at least 21 years old
Creating a New ODI Interface to Perform XML File to RDBMS Table
Transformation

To create a new ODI Interface to perform XML file to RDBMS table transformation, pefrom the following steps:

1. In ODI Designer, click the Projects tab. Expand your project ODI_exp_XML-RT, and then expand First Folder.
Right-click Interfaces and select New Interface. In Optimization Context field, select Global.

2. On the screen that follows, enter the interface name as INT-LOAD_TBL_CLIENT . Set Optimization context to
Global. Click Mapping tab.
3. Click the Models tab to drag the source and target to the diagram. Drag the CLIENT data store from the
SRC_GEO_DIM_XML into the Source container and Drag the CLIENTdata store from the RDBMS_TARGET into
the Target container. When Designer asks “Do you want to perform an Automatic Mapping?” click Yes.

4. In the target datastore, select CLIENT_ID column. Scroll down to select the Key option, as shown below. Click the
Flow tab.
5. Click Definition tab again, and make sure that the settings match those provided iin the table below. Click the flow
tab.

Parameter Value
Name INT_LOAD_TBL_CLIENT
Staging Area Different From Target Select this option
In-Memory Engine Sunopsis_Memory_Engine
6. Click the Flow tab. Click the Satging Area, and then in LKM Selector, select: LKM SQL to SQL. Click the Target
datastore . In the Target properties, select the following options, and then click Control tab. In the Control tab,

verify settings and save your interface .

Note: Incase you get an Object Locking dialog box, click No.

Option Value
RECYCLE_ERRORS true
CREATE_TARG_TABLE true
7.
To test your interface, click Execute button . The following screen appears. Retain the defaults and click OK.
On the next screen, click OK.

8. Open ODIOperator and verify that your interface was executed successfully. In Operator, click Session List tab,

select All Executions, and the then click refresh button . View execution results for interface ODI_exp_XML-
RT, as shown below.
9. Double-click Step 16 and click the Execution tab. View the number of rows inserted into the error table E_CLIENT
in ODI_STAGE schema.

Note: Optionally, you can open SQL Developer, navigate to Administrator > Other Users > ODI_STAGE > Tables
> E_CLIENT, and view error records populated in E_CLIENT error table.
10 . Open the Interface tab. Select Mapping tab, right-click Target Datastore - CLIENT, and then select Data. View
Data inserted in the target table. Close Data Editor. Close the tabs.
Summary

In this tutorial, you have learned how to:

 Verify the Prerequisites


 Create a New Project with Oracle Data Integrator
 Create new Data server and Physical schema for a new XML model
 Create new RDBMS schema for the ODI target datastore
 Create ODI target data server and physical schema
 Create a new ODI XML source model
 Create a new ODI target model that will be used within ODI Interface
 Set up the ODI constraint on CLIENT target datastore
 Create a New Interface with Oracle Data Integrator for XML file to RDBMS table data transformation
7) Setting Up an ODI Agent

Overview

A common task that is performed using ODI is to set up and install ODI Agent. After the ODI scenarios are
created, they can be scheduled and orchestrated using an ODI Agent, which is a lightweight Java process that
orchestrates the execution of ODI scenarios. . This tutorial walks you through the steps that are needed to set up
and install the ODI Agent . For this example, you use the ODI procedure that was created in the OBE titled
Creating an ODI Procedure to Create and Populate a Relational Table. You also verify the execution of the
procedure within ODI Operator.

Scenario

Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for
performing database management and integration tasks on various resources within the organization. In
particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects,
Linda created the new Master repository and Work repository. Linda also created the project and the procedure
to create a relational table and populate it with data. Now Linda needs to set up and install an ODI Agent as a
service.

Software and Hardware Requirements

The following is a list of software requirements:

 The system should include the following installed products:


o Oracle Database 11g
o Oracle Data Integrator 11gR1
 If not done before, start the services and components for Oracle Database 11g

Prerequisites

Before you start the tasks, make sure that your system environment meets the following requirements:

1 . Have installed Oracle Database 11g. If not done before, start the services and components for Oracle Database 11g

2 . Have installed Oracle Data Integrator 11gR1


3 . Before attempting this OBE, you should have successfully completed the following OBEs:

ODI11g: Creating and Connecting to ODI Master and Work Repositories.

To access this OBE, click HERE.

ODI11g: Creating an ODI Project and Procedure to Create and Populate a Relational Table.

To access these OBEs, click HERE.

Incode ODI Agent Password

Before creating an ODI agent, you must run the encode password command to generate an encrypted password
and paste it into the odiparams.bat parameter file. To do so, perform the following steps:

1. Navigate to the ODI_HOME directory, where ODI is installed and open the agent\bin sub-directory:
( C:\Oracle\Middleware\Oracle_ODI1\oracledi\agent\bin). Navigate to the odiparams.bat file, right-click this file and
select Edit to open it with a text editor. Leave this editor open; you will run a batch file from a Command window and
return to this text editor to copy the results into the odiparams.bat file.
Explanation: You need to edit the odiparams.bat file to set the repository connection information for the ODI Agent to
use. The password information is stored as an encrypted string. You will generate the encrypted string in a
Command window.

2. Leave the text editor open, and open the Command window (Start -> Run -> cmd) and change the directory to the
ODI_HOME\agent\bin directory:

C:\Oracle\Middleware\Oracle_ODI1\oracledi\agent\bin

3. To generate the encrypted password string, you will be using the agent command: encode <password>. Because
your password is the word “ oracle1”, enter and execute the following command in the Command window:

encode oracle1

Keep the Command window open, as you will be returning to it after editing the odiparams.bat file.

4. Copy the generated encrypted password from the Command window (from the Command window’s pull-down menu,
select Edit > Mark, then highlight the password with your mouse) and insert it into the odiparams.bat file as the value
for the ODI_MASTER_ENCODED_PASS parameter. Verify and, if necessary, edit settings for other parameters from
the table below, save the odiparams.batfile, and then close it. The agent’s connectivity is now set up.

Value
Parameter
ODI_MASTER_DRIVER oracle.jdbc.OracleDriver
ODI_MASTER_URL jdbc:oracle:thin:@localhost:1521:orcl
ODI_MASTER_USER snpm1
ODI_MASTER_ENCODED_PASS Insert your encoded password.
ODI_SECU_WORK_REP WORKREP1
ODI_SUPRVISOR_ECODED_PASS Leave the default value.
ODI_USER Leave the default value.
ODI_ENCODED_PASS Leave the default value.
ODI_JAVA_HOME C:\jdk1.6.0_18
Notes:

User snpm1 is RDBMS schema/user (Oracle 11g) for Master repository. It was created for this and subsequent
OBEs in OBE "Creating and Connecting to ODI Master and Work Repositories".

Work Repository name is WORKREP.

Because each time when you encode the password, it gets different values, your encoded password will differ from
the one provided in the screenshot.

Do not change the default value of the ODI_USER and ODI_ENCODED_PASS parameters. Those parameters were
pre-coded during ODI installation.
Create the ODI Physical and Logical Agents
Now that you have generated an encoded password and pasted it into the odiparams.bat file, you need to create
the ODI physical and logical agent definitions.

1. If not started, start Oracle Data Integrator: Start > Programs > Oracle > Oracle dat Integrator > ODI Studio. Click
“Connect To Repository”. Select WORKREP1 from the LoginName drop-down list. For Password, enter: SUNOPSIS.
Click OK.
2. Click Topology tab. In Topology, select the Physical Architecture panel. Right-click the Agents node. Select New
Agent.

3. Fill in the following fields:


Name: localagent
Host: Network name or IP address of the machine the agent has been launched on. Verify that this
parameter is set to localhost.
Port: Listening port used by the agent. By default, this port is 20910. Leave the default value.
Web Application Context: Name of the web application corresponding to the J2EE agent deployed on an
application server. For standalone agents, this field should be set to oraclediagent.
Set Maximum number of sessions supported by this agent to 250.

Click Save button.

4. Now you have to insert a logical agent in Logical Architecture, and map it to the newly created Physical agent. Click
the LogicalArchitecturetab. Right-clickAgents and select New LogicalAgent. On the screen that follows, set the Name
to “localagent.” Set Physical Agents to localagent . From file menu click Save, and then close the Logical Agent tab.
Starting ODI Agent from the Command Line and Testing Connection

Now that you have created the agent and defined the ODI physical and logical agents, you can start the agent
directly from the command line. You also test connection to your ODI standalone agent.

1. Switch back to the Commandwindow you left open at the ODI_HOME\agent\bin directory
( C:\Oracle\Middleware\Oracle_ODI1\oracledi\agent\bin). Execute the agent.bat file using the following command:

agent -NAME=localagent

The agent is now starting. Verify that ODI Agent is successfully started. Minimize the window Command Prompt –
agent-NAME=localagent.

Note : This command window should remain open during all labs.
2. In ODI, click Test icon to verify connection of the ODI agent localagent. Click OK.

You successfully created and connected to ODI agent.

Executing an ODI Object with ODI Agent

With ODI Agent, expand project you execute the PRGcreate-populate_table procedure that creates and
populates a relational table. This procedure was created in the OBE titled Creating an ODI Procedure to Create
and Populate a Relational Table. To access this OBE, click HERE.

1. In ODI designer, right-click the PRGcreate-populate_table procedure and select Execute. In the window that
appears, click the Agent drop-down list and select localagent. Click OK to execute the job with the localagent
agent. When the Information screen shows the "Session started" message, click OK.
2. Click the ODI Operator tab to open ODI Operator. In ODI Operator, click the Session List tab, and then click the
Refresh icon. Expand: Physical Agent > localagent -1> PRD_CREATE_POPULATE_TABLE, and view the
execution results for the PRD-create-populate-table procedure. Verify that procedure PRD-create-populate-table
executed successfully.
Summary

<Include a short summary of what users accomplished by following all the steps. You may also include additional
information that you think is relevant and helpful, optional additional exercises for the user to learn more about
related functionality, and related topics links, as described in the Resources section below.>

In this tutorial, you have learned how to:

 Verify the Prerequisites


 Encode ODI Password
 Set up the ODI Agent
 Execute an ODI Object with the ODI Agent
8) Creating and Scheduling an ODI Scenario

Overview

When a set of objects is complete and tested, a good practice is to create an ODI scenario for each object. After
a scenario is created, it cannot be edited and the code for the object is regenerated and stored in the scenario.
The created scenarios can also be scheduled for running virtually on any time interval within ODI. In this OBE,
you create and schedule a scenario for the ODI procedure that was created in the OBE titled Creating an ODI
Project and Procedure to Create and Populate a Relational Table.

Scenario

Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for
performing database management and integration tasks on various resources within the organization. In
particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects,
she created the new Master repository and Work repository. Linda also created the project and the procedure to
create a relational table and populate it with data. She set up and installed an ODI Agent as a service. Now Linda
needs to create and schedule an ODI scenario to run the procedure at the appropriate time.

Software and Hardware Requirements

The following is a list of software requirements:

 The system should include the following installed products:


o Oracle Database 11g
o Oracle Data Integrator 11gR1
 If not done before, start the services and components for Oracle Database 11g

Prerequisites

Before you start the tasks, make sure that your system environment meets the following requirements:

1. Have installed Oracle Database 11g. If not done before, start the services and components for Oracle Database
11g
2. Have installed Oracle Data Integrator 11gR1
3. Before attempting this OBE, you should have successfully completed the following OBE:

ODI11g: Creating and Connecting to ODI Master and Work Repositories.


ODI11g: Creating and Connecting to ODI Agent
ODI11g: Creating and ODI procdure to Create and Populate RDBMS Table

To access these OBEs, click HERE.

Create a New ODI Scenario with Oracle Data Integrator

To create a new ODI Scenario with ODI, perform the following steps:

1 . Start ODI Designer: Start > Programs > Oracle > Oracle Data Integrator > ODI Studio . Select WORKREP1 from
the Login Name drop-down list if not already selected. Enter SUPERVISOR in the User field and SUNOPSIS in the
Password field. Click OK to login.
2 . Expand the PRD-create-populate_table procedure and expand Scenarios. Right-click the
PRD_CREATE_POPULATE_TABLE scenario, and then click Generate Scenario as shown in the following
screenshot.
Note: The scenario has now been successfully created. You can now execute the scenario directly, use the scenario
within a package, or schedule the scenario within ODI.
Scheduling the ODI Scenario

Now you need to schedule an ODI scenario with ODI Agent. To schedule the scenario, perform the following
steps:

1. In Topology Navigator, open: Physical Architecture > Agents > localagent. Click Test to verify connection to ODI agent, as show
Note: If ODI Agent is not set up and running, you have to perform steps specified in OBE "Setting UP and Installing an ODI Age
2. Expand the PRD-create-populate-table procedure. Expand Scenarios > PRD_CREATE_POPULATE_TABLE Version 001. Righ
New Scheduling.
Note: To schedule a scenario, an ODI Agent must be set up. If an ODI Agent is not set up within the ODI Topology Manager, p
Installing an ODI Agent.”
3. On the screen that follows, select the agent where the scheduled scenario will run: localagent. Set Context as Global and log l
Simple and click the button. Set the execution time to approximately 5 minutes from the current system time as shown in th
Save button.
4 . Expand Scheduling and verify that the DEVELOPMENT / localagent entry is now inserted under Scheduling.
5 . Open Topology Navigator to review the scheduling of the Agent. In the Physical architecture, expand the Agents node, double-c
localagent screen, click Update Schedule. On the screen that follows, click OK. Click OK again.

6 . .Click the View Schedule button. The screen that appears shows you the scheduling information.
Verify Execution of Scheduled ODI Scenario

To verify the execution of the scheduled scenario, perform the following steps:

1. Click the ODI Operator tab to open ODI Operator. In ODI Operator, click the Session List tab. Wait until scheduled
execution time to view the execution results, and then click the Refresh icon.

2. Expand: Physical Agent > localagent -1> PRD_CREATE_POPULATE_TABLE, and view the execution results for
the PRD-create-populate-table procedure. Note the execution time of this scenario. That is the time that you
scheduled with ODI Agent. You have now successfully scheduled a scenario with an agent scheduler.

Summary

In this tutorial, you have learned how to:

 Verify the Prerequisites


 Create an ODI Scenario with Oracle Data Integrator
 Schedule an ODI Scenario with Oracle Data Integrator
 Verify the Execution of the Scheduled ODI Scenario with Oracle Data Integrator

9)

You might also like