322
Oracle Data Integrator 11g: Advanced Integration and Development Activity Guide D78191GC10 Edition 1.0 February 2013 D80590 Oracle University and (Oracle Corporation) use only. These eKit materials are to be used ONLY by you for the express purpose SELF STUDY. SHARING THE FILE IS STRICTLY PROHIBITED.

D78191GC10_ag

  • Upload
    al

  • View
    52

  • Download
    10

Embed Size (px)

DESCRIPTION

Oracle Data Integrator 11g:Advanced Integration andDevelopment - AG

Citation preview

Page 1: D78191GC10_ag

Oracle Data Integrator 11g: Advanced Integration and Development

Activity Guide

D78191GC10

Edition 1.0

February 2013

D80590

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 2: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Disclaimer This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. Restricted Rights Notice If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract. Trademark Notice Oracle and Java are registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Author

Viktor Tchemodanov

Technical Contributors and Reviewers

Denis Gray, Alex Kotopoulis, Julien Testut, Christophe Dupupet, Rebecca Sly, Gerry Jurrens, Sophia Chen, Vishal Parashar, Richard Green

This book was published using: Oracle Tutor

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 3: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Oracle Data Integrator 11g: Advanced Integration and Development Table of Contents

iii

Table of Contents

Practices for Lesson 1: Introduction ........................................................................................................ 1-1 Practices for Lesson 1: Overview ............................................................................................................. 1-2 Practice 1-1: Exploring Your Environment ................................................................................................ 1-3

Practices for Lesson 2: Overview of ODI Knowledge Modules ................................................................ 2-1 Practices for Lesson 2: Overview ............................................................................................................. 2-2 Practice 2-1: Developing and Enhancing an Integration Knowledge Module .............................................. 2-3

Practices for Lesson 3: Developing Knowledge Modules........................................................................ 3-1 Practices for Lesson 3: Overview ............................................................................................................. 3-2 Practice 3-1: Creating a New KM for Data Generation .............................................................................. 3-3

Practices for Lesson 4: Designing ODI Integration Interfaces ................................................................. 4-1 Practices for Lesson 4: Overview ............................................................................................................. 4-2 Practice 4-1: Creating an ODI Interface for XML to Database Transformation with ODI Constraint and Error Recycling ................................................................................................................................................ 4-3

Practices for Lesson 5: Designing Advanced Integration Interfaces ...................................................... 5-1 Practices for Lesson 5: Overview ............................................................................................................. 5-2 Practice 5-1: Implementing ODI Integration with Temporary Interfaces...................................................... 5-3

Practices for Lesson 6: Using Variables in ODI ....................................................................................... 6-1 Practices for Lesson 6: Overview ............................................................................................................. 6-2 Practice 6-1: Using Variables in ODI Package .......................................................................................... 6-3 Practice 6-2: Using an ODI Variable as a Startup Parameter .................................................................... 6-22

Practices for Lesson 7: Accelerating Development in ODI with Groovy ................................................. 7-1 Practices for Lesson 7: Overview ............................................................................................................. 7-2 Practice 7-1: Automating ODI Tasks with Groovy ..................................................................................... 7-3

Practices for Lesson 8: Working with Complex Files in ODI ................................................................... 8-1 Practices for Lesson 8: Overview ............................................................................................................. 8-2 Practice 8-1: Configuring ODI Topology and ODI Model with Complex Files.............................................. 8-3

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA .................................... 9-1 Practices for Lesson 9: Overview ............................................................................................................. 9-2 Practice 9-1: Integrating ODI in the Enterprise Environment ..................................................................... 9-3 Practice 9-2: Exposing an ODI Scenario as a Web Service....................................................................... 9-17 Practice 9-3: Integrating ODI with a BPEL process Within SOA ................................................................ 9-30

Practices for Lesson 10: Enhancing ODI Security ................................................................................... 10-1 Practices for Lesson 10: Overview ........................................................................................................... 10-2 Practice 10-1: Implementing ODI External User Authentication ................................................................. 10-3

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 4: D78191GC10_ag

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 5: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction

Chapter 1 - Page 1

Practices for Lesson 1: Introduction

Chapter 1

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 6: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction

Chapter 1 - Page 2

Practices for Lesson 1: Overview

Practices Overview In this practice, you will explore the technical environment for your practices and start the ODI studio.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 7: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction

Chapter 1 - Page 3

Practice 1-1: Exploring Your Environment

Overview In this practice, you examine the technical setup for these practices, start up, and connect to the ODI Studio.

Assumptions None

Tasks 1. View the major software components installed in your system. These components are

shown in the picture. Your environment has the following major components:

• Oracle Database 11gR1 (11.1.0.7.0)

• Oracle Data Integrator 11gR1 (11.1.1.6)

• Oracle WebLogic Server (10.3.6)

• Oracle SOA Suite (11.1.1.6)

• Oracle Internet Directory (11.1.1.6.0)

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 8: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction

Chapter 1 - Page 4

2. View the desktop of your machine. Note the following shortcuts: a. ODI Studio: Starts ODI Studio

b. SQL Developer: Starts SQL Developer, which provides access to the objects in Oracle

Database 11gR1 with GUI

c. JDeveloper: Starts JDeveloper, which simplifies working with projects and deploying

to the application server (WebLogic)

d. Start WLS_SOA_ODI_domain: This shortcut starts the WebLogic admin server in

SOA-ODI_domain. This domain has been predefined for these practices.

3. Navigate to the C:\Labs folder.

a. View this folder’s content. The Files folder contains some files that will be used for your practices.

b. Note the folder named ResetPractice. This folder contains the scripts for resetting practices in the course. You will use these scripts at the beginning of each practice. These scripts are also useful when you feel that you need to restore a particular practice environment and begin your practice from scratch. Close your folder window. Note: These scripts are available for most, but not every practice of the course. Consult your instructor for details.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 9: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction

Chapter 1 - Page 5

4. Start Oracle Data Integrator and log in to ODI Studio. Start your demo source environment.

Step Screen/Page Description Choices or Values

a. MS Windows Start Oracle Data Integrator: Start > Programs > Oracle > Oracle Data Integrator > ODI Studio.

b. Oracle Data Integrator Click Connect to Repository…. The Login Name is DEV_ODI_REPO. You log in with the username SUPERVISOR and password SUNOPSIS. Click OK.

c. Oracle Data Integrator In ODI Studio, open the Designer tab. Open the Projects and Models tabs. Verify your environment with the screenshot provided.

d. Oracle Data Integrator Start the Demo environment: Start > Programs > Oracle > Oracle Data Integrator > Shortcut to startdemo.

Verify that three command windows are added to the taskbar. You will need to have these programs running. Do not close these windows until the end of all practices.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 10: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction

Chapter 1 - Page 6

a.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 11: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction

Chapter 1 - Page 7

b.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 12: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction

Chapter 1 - Page 8

c.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 13: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction

Chapter 1 - Page 9

d.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 14: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction

Chapter 1 - Page 10

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 15: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 1

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 16: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 2

Practices for Lesson 2: Overview

Practices Overview In Practice 2-1, you duplicate an existing knowledge module and modify the duplicate knowledge module to enhance it with substitution methods.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 17: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 3

Practice 2-1: Developing and Enhancing an Integration Knowledge Module

Overview In some cases, you may need to create a new knowledge module (KM) to use with an integration interface. That would provide additional functionality of your interface.

In this practice, you duplicate an existing KM, IKM SQL Incremental Update, naming the new KM as IKM Oracle UI-Audit. You add two commands, “Create Audit Table” and “Insert Audit Records,” to the KM by using substitution methods. To test your newly created KM, you duplicate an existing interface, naming the new interface as INT-INT-SALES_PERSON-AUDIT. You change the new interface’s IKM selection to use the new KM you just created in the previous practice, IKM Oracle UI-Audit. You execute the INT-SALES_PERSON-AUDIT interface and examine the audit table created by your KM.

You also make additional enhancements of the KM created in the previous practice. You create an option for your new KM to enable an end user to choose when to generate audits. You link this option to the steps in the KM, and test your modified interface.

Your Tasks 1. Reset your practice environment.

a. Verify that ODI Studio and SQL developer are not running. If they are running, close ODI Studio and SQL Developer.

b. Start the command utility and change the directory to the following folder: C:\Labs\ResetPractice\reset_2

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 18: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 4

c. Execute the resetRepo.bat command. Press Enter when prompted. Verify that this command is executed successfully as shown in the following screenshot.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 19: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 5

2. Create the new KM with new functionality to create an audit table and insert audit records.

a. If not started, start Oracle Data Integrator: Start > Programs > Oracle > Oracle Data Integrator > ODI Studio. If not connected, connect to the DEV_ODI_REPO Work Repository (username: SUPERVISOR; password: SUNOPSIS). Click the Designer tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 20: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 6

b. Open ODI Designer and click the Projects tab. Select Projects > Export Files >

Knowledge Modules > Integration (IKM). Right-click IKM SQL Incremental Update and select Duplicate Selection. In the window that follows, click Yes.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 21: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 7

Double-click Copy of IKM SQL Incremental Update to edit it. Rename this KM IKM SQL Incremental Update – Audit Options. Click the Details tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 22: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 8

c. On the Details screen, review the commands in the current KM. Select Insert new

rows and then click the Add icon to add the new command.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 23: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 9

d. Name this command Create Audit Table. Select the Ignore Errors check box. In the Command on Target tab, set the Technology to Oracle. Enter the following command to create the audit table. Verify that the check boxes in the Journalizing section are not selected. If necessary, deselect them. Note: This command creates the Audit table with three columns: the primary key column (SALES_PERSON_ID), AUDIT_DATE, and AUDIT_INDICATOR.

Note: For this command, refer to the C:\Labs\Files\Text\P2-1.txt file.

create table <%=odiRef.getTable("L", "TARG_NAME", "A")%>_H

(

<%=odiRef.getColList("", "[COL_NAME]\t[DEST_CRE_DT]NULL", ",\n\t", "", "PK")%>,

AUDIT_DATE DATE,

AUDIT_INDICATOR VARCHAR2(1)

)

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 24: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 10

e. Click the Details tab. If necessary, scroll down, and then select the Create Audit

Table command. Click the icon four times to move the command up and place it

right after the Insert new rows step (150), as shown below. Verify that the Ignore

Errors check box is selected for your new Create Audit Table command.

f. With the Create Audit Table command still selected, click the Add icon again.

Create the command that inserts audit records in the audit table, as shown below. This command uses the following substitution methods: odiRef.getTable and odiRef.getColList. Name this command Insert Audit Records. Select the Ignore Errors check box. In the Command on Target tab, set the Technology to Oracle. The command is provided below.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 25: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 11

Insert into <%=odiRef.getTable("L", "TARG_NAME", "A")%>_H

(

<%=odiRef.getColList("", "[COL_NAME]", ",\n\t", "", "PK")%>,

AUDIT_DATE,

AUDIT_INDICATOR

)

select <%=odiRef.getColList("", "[COL_NAME]", ",\n\t", "", "PK")%>,

sysdate,

IND_UPDATE

from <%=odiRef.getTable("L","INT_NAME","W")%>

Note: For this command, refer to the C:\Labs\Files\Text\P2-1.txt file.

Note: In these substitution methods, you use the following parameters:

GetTable:

• “L”: Local naming convention. For example, in Oracle that would be schema.table (versus “R” for remote: schema.table@server).

• “A”: Automatic. It enables ODI to determine which physical schema to use (the Data schema [“D”] or the Staging schema [“W”]).

• Notice the “PK” parameter. If it is used, only the columns that are part of the primary key are included.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 26: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 12

`

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 27: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 13

g. Click the Details tab. Scroll down and select the Insert Audit Records command.

Click the icon four times to move the command up and place it right after the

Create Audit Table step, as shown in the next screen. Click Save and then close

the tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 28: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 14

h. Click the Save button, and close the editor. Verify that your new KM, IKM SQL Incremental Update – Audit Options, appears in the Knowledge Modules tree.

3. You will create a modified copy of the INT-TRG_SALES_PERSON interface, to execute with your newly created KM. You will need to duplicate the existing interface, rename it, and then change the IKM entry to use your new IKM SQL Incremental Update – Audit Options.

a. On the Projects tab, expand the project Export Files, expand First Folder > Interfaces, right-click the INT-TRG_SALES_PERSON interface and select Duplicate Selection. Click Yes on the Confirmation screen.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 29: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 15

b. Double-click the Copy of INT-TRG_SALES_PERSON interface. Change the name of

the interface to INT-TRG_SALES_PERSON-Audit, as shown in the screenshot. Click the Flow tab.

On the Flow tab, click Target (ODI_STAGE) in the diagram to open the Target Area – Property Inspector below the diagram. In the IKM Selector drop box, select IKM SQL Incremental Update – Audit Options.

Note: You may have to make sure that the lower section of the editor is shown before working with the Target Area – Property Inspector pane.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 30: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 16

c. Ensure that in the Options list, FLOW_CONTROL and STATIC_CONTROL options are set to “false,” as shown in the screenshot. Click the Save button and then close the tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 31: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 17

To execute your new interface, select the interface and click the Execute button . Click OK. Click OK again in the Information window to start the execution.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 32: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 18

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 33: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 19

d. Click the Operator tab to open ODI Operator. Click to open the All Executions node. If

necessary, click the Refresh icon , find your new interface session, and view the

session steps.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 34: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 20

e. Scroll down and double-click the Create Audit Table step (13). View the content of the Definition and Code tabs for this step. Close the tab. Note: You may have warning status for this Session task if the Audit table already exists in your system. Ignore this warning.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 35: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 21

f. Similarly, view the Insert Audit Records step information. Refer to the following screens. Click Close.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 36: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 22

g. On the Desktop, double-click the shortcut to start Oracle SQL Developer. When SQL

developer is started, click to expand the ORCL connection. Connect with the username

System and password oracle1. Expand Other Users > ODI_STAGE > Tables

connection (for the password, enter ODI_STAGE). Select the Tables (Filtered) node

and if necessary, click the Refresh button . Click the Audit table

TRG_SALES_PERSON_H, click the Data tab, and verify that your Audit table was

created and populated with audit records, as shown next.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 37: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 23

Create an option for your newly created KM to enable an end user to choose when to generate audits. h. In Designer, click the Projects tab, right-click IKM Oracle UI – Audit Options, and

select New Option. Name this option as AUDIT, set Type to Check Box, and Default Value to “true”. Click Save and close the AUDIT option tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 38: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 24

i. Now, you need to link this option to your steps in the KM. Double-click IKM SQL

Incremental Update – Audit Options, and click the Details tab. Double-click your new step, Create Audit Table, to edit it. Scroll to the bottom and click the Options plus sign [+] to show its contents.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 39: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 25

j. Deselect the Always Execute check box. Select AUDIT. This will condition the

execution of these steps with the value set by the end user. Click Save. Click the Details tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 40: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 26

k. Repeat the previous step for the Insert Audit Records command, as shown in the following screens. Click Save to save your KM and close the tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 41: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 27

l. Double-click the INT-TRG_SALES_PERSON-Audit interface to edit it. Click the Flow tab, click Target (ODI_STAGE), and verify that the AUDIT option is set to “true”.

Execute the interface .

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 42: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 28

m. Open ODI Operator, select All Executions, and then click the Refresh button and view the execution results. Both Create Audit Table and Insert Audit Records steps should be present.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 43: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 29

n. In Designer, edit the INT-SALES_PERSON-Audit interface again. On the Flow tab, click Target (ODI_STAGE) and set the AUDIT option to “false”. Save your interface

and then execute your interface again .

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 44: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Overview of ODI Knowledge Modules

Chapter 2 - Page 30

o. In ODI Operator, click the Refresh button and view the execution results. The new KM steps to create and populate an audit table are not executed.

p. Close ODI Studio. If open, close SQL Developer.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 45: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 1

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 46: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 2

Practices for Lesson 3: Overview

Practices Overview In Practice 3-1, you create a new knowledge module (KM) that can be used with ODI integration interfaces for generating thousands of records with random data in any table in the Oracle Database. In most cases, column names and mapping expressions do not belong to a KM. The exception would be administrative columns that you add as part of the logic of your KM. For your KM to be reusable, you need make sure that your code contains no information that physically relates your code to any particular database table structure.

Your new KM is to generate a large number of records with some random data. To generate data for each record that would meet particular requirements, you use simple user functions that have been precreated for this practice.

In addition, you create options for your KM to add some flexibility to your KM. With these options, you can set the number of records you want to generate. You can also set the option for creating or truncating a target table.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 47: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 3

Practice 3-1: Creating a New KM for Data Generation

Overview The Oracle Database provides an interesting feature that can be used to generate a large number of records – the group by cube method: It returns all the possible permutations for the selected columns. For example, the following code returns 8 records (2 to the power 3):

select NULL from dual group by cube(1,1,1). How about generating a table with just 1,000 records? For that, you can use the following code:

select NULL from dual group by cube(1,1,1,1,1,1,1,1,1,1) where rownum<=1000

This command is hardcoded. Because from one environment to another, the database schema names will vary, you have three options to create the staging table, from the least portable to the most portable:

• Hardcoded table name and schema name (for example, myschema.SEED)—not recommended

• Dynamic schema name, but hardcoded table name: ODI retrieves the proper schema name and automatically updates the code at the execution time (generated code: myschema.SEED).

• Fully dynamic table name and schema name (usually, dynamic tables are named after the target table with some extension, for example, _SEED). In this case, the generated code for the TRG_CUSTOMERS loading table, the SEED table name is myschema.TRG_CUSTOMER_SEED.

Note: In this practice, you use the second option above for simplicity.

The statement above would help you to generate a table that only has 1,000 records. To create a table with 1,000,000 records, you need to have a Cartesian product by executing the following statement:

insert into [Target] ([Columns]) Select * from SEED S1, SEED s2

In case you need to return fewer records, all you have to do is filter on the S2 table. For example, the following clause returns 10,000 records.

where S2.SEED_ID<=10

The actual number of records to be created in the table is defined by the option you create for the KM.

To generate the random data, you create an integration interface that uses simple user functions in mappings. These user functions have been predefined for the purpose of this practice. Note: You develop the KM that works for Oracle Database. Adaptations of the code for other databases are possible.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 48: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 4

Your Tasks

1. Reset your practice environment. a. Verify that ODI Studio and SQL developer are not running. If they are running, close

ODI Studio and SQL Developer.

b. If necessary, start the command utility and change the directory to the following folder: C:\Labs\ResetPractice\reset_3. Execute the resetRepo.bat command. Press Enter when prompted. Verify that this command is executed successfully.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 49: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 5

2. Create your new KM.

a. Start Oracle Data Integrator: Start > Programs > Oracle > Oracle Data Integrator > ODI Studio. If not connected, connect to the DEV_ODI_REPO Work Repository (username: SUPERVISOR; password: SUNOPSIS). Click the Designer tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 50: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 6

b. In Designer, click the Projects tab, expand Procedures > Knowledge Modules. Right-click Integration (IKM) and select New Integration (IKM). In the Name field, enter IKM Oracle – Build Sample Data. Click the Details tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 51: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 7

c. Click Add icon to add the first step. Name this step as Drop SEED table. Select the Ignore Errors check box. In the Command area, enter drop table <%=odiRef.getObjectName("L", "SEED1", "W")%> Note: For the commands used in this practice, you can refer to the P3-1.txt file located in the C:\Labs\Files\Text folder.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 52: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 8

d. Click the Details tab. Click Add icon and then add another command to create the SEED table: create table <%=odiRef.getObjectName("L", "SEED1", "W")%>(SEED_ID NUMERIC)

Name this command: Create SEED table.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 53: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 9

e. In the next step, you will populate the SEED table with records. Add the following command:

insert into <%=odiRef.getObjectName("L", "SEED1", "W")%>

select rownum from

(select NULL from dual group by cube(1,1,1,1,1,1,1,1,1,1))

where rownum<=1000

name this command: Populate SEED table.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 54: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 10

f. To create a target table, you add the following command. Select the Ignore Error check box. Name this command Create target table.

Note: This command is necessary only when a target table does not exist. Click the Details tab. create table <%=snpRef.getTable("L", "TARG_NAME", "A")%>

(

<%=snpRef.getTargetColList("", "[COL_NAME]\t[DEST_CRE_DT] " + snpRef.getInfo("DEST_DDL_NULL"), ",\n\t", "")%>

)

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 55: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 11

g. Add the command to truncate the target table as shown below. Name this command Truncate target table. Click the Details tab.

truncate table <%=snpRef.getTable("L","TARG_NAME","A")%>

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 56: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 12

h. Add the command to delete records in the target table. Name this command Delete Target table. For Log Counter, select Delete. In the Transaction field, select Transaction1. In the Commit field, select No Commit. Click the Details tab.

delete from <%=snpRef.getTable("L","TARG_NAME","A")%>

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 57: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 13

i. Add the command to insert new rows in the target table. Set the Log Counter to Insert. In the Transaction field, select Transaction1. In the Commit field, select No Commit. Note the odiRef.getOption method. It is used to get the option for setting the number of thousands of records. insert into <%=snpRef.getTable("L","TARG_NAME","A")%>

(

<%=snpRef.getColList("", "[COL_NAME]", ",\n\t", "", "((INS) and REW)")%>

)

select <%=snpRef.getColList("", "[EXPRESSION]", ",\n\t", "", "((INS) and REW)")%>

from

<%=odiRef.getObjectName("L", "SEED1", "W")%> S1,

<%=odiRef.getObjectName("L", "SEED1", "W")%> S2

where S2.SEED_ID<= <%=odiRef.getOption("THOUSANDS_OF_RECORDS")%>

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 58: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 14

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 59: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 15

j. Add the command to Commit the transaction: /* commit */. Name this step Commit. In the Transaction field, select Transaction1. In the Commit field, select Commit. Click the Details tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 60: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 16

k. Add the final step to Drop the SEED table. Enter the following command: drop table <%=odiRef.getObjectName("L", "SEED1", "W")%>

Name this step Drop SEED table. Click the Details tab and verify the steps, which are shown in the following screenshots. Click the Save icon to save the KM and close the tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 61: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 17

3. To add flexibility to your KM, you will create the options. a. Right-click the IKM Oracle - Build Sample Data KM and select New Option. In the

Name field, enter TRUNCATE. In the Type field, select Check Box. Set the Default value to True. In the Description field, enter Truncate the target datastore. Save this option and close the tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 62: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 18

b. Similarly, create another option. In the Name field, enter CREATE_TARGET_TABLE. For the Type field, select Check box. Set the Default value to False. In the Description field, enter Create Target Table. Save this option and close the tab.

c. Create the option to control. In the Name field, enter THOUSANDS_OF_RECORDS. For the Type field, select Value. Set the Default value to 10. In the Description field, enter Thousands of records to generate. Save this option and close the tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 63: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 19

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 64: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 20

d. Add the options to your KM steps. Open the IKM Oracle - Build Sample Data KMs for editing. Click the Details tab. Double-click Create Target table.

e. Scroll down and select Options. Deselect the Always Execute check box and select the Create Target Table option. Click the Details tab.

f. Double-click Truncate Target Table command. In the Options section, deselect Always Execute and select TRUNCATE. Click the Details tab. Click Save and close the tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 65: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 21

4. You generate data and populate the SALES_SAMPLER datastore located in the Oracle_RDBMS1 model. The Oracle Database comes with a package called DBMS_RANDOM. The following functions will be used in this practice:

• RandomNumber(Min, Max): Generates a random value (without decimals) between the Min and Max values

• RandomString(Format, Min, Max): Generates a random string with a minimum of Min characters and a maximum of Max characters. The valid formats are:

o 'u', 'U' – Returning string in uppercase alpha characters

o 'l', 'L' – Returning string in lowercase alpha characters

o 'a', 'A' – Returning string in mixed case alpha characters

o 'x', 'X' – Returning string in uppercase alpha-numeric characters

o 'p', 'P' – Returning string in any printable characters

• RandomBool(): Generate a 0 or a 1

• RandomDecimal(Min, Max): Generates a random value (with decimals) between the Min and Max values

• (MinDate, MaxDate): Returns a date between MinDate and MaxDate (make sure MinDate and MaxDate are valid dates for Oracle)

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 66: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 22

a. To import user functions in your project Procedures, right-click User Function and select Import. Navigate to C:\Labs\Files\xml_samples\UserFunctions and click Open. Select RandomBool and click OK. In the Import Report window, click Close.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 67: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 23

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 68: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 24

b. Expand the RandomGenerators node and verify that the RandomBool function is added to the tree.

c. Repeat the previous steps to add RandomDate, RandomDecimal, RandomNumber, and RandomString functions. Verify that these functions are added under the RandomGenerators node.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 69: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 25

5. Create an interface to generate data in the SALES_SAMPLER datastore.

a. On the Projects tab, expand Procedures > First Folder. Right-click Interfaces. Select New Interface. Name your interface INT_SALES_SAMPLER. Click the Mapping tab.

b. On the Models tab, expand the Oracle_RDBMS1 model, select the SALES_SAMPLER datastore, and then drag it to the target section of the INT_SALES_SAMPLER interface.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 70: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 26

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 71: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 27

c. In the Target datastore section, select the SAMPLER_ID column. In Mapping Properties, enter the following mapping expression on the Implementation tab: RandomNumber(1,999). Click the SAMPLER_ID column again and in the Execute on field, select Staging Area.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 72: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 28

d. Similarly, implement mapping for each column in the Target datastore. In the Execute on field, select staging area for each column. Refer to the following table:

Column Mapping

SAMPLER_ID RandomNumber(1,999)

SAMPLER_NAME RandomString('A', 1, 30)

SAMPLER_PROMOTION case when RandomBool()=0 then 'FALSE'else 'TRUE' end

SAMPLER_PRICE RandomDecimal(1,10000)

SAMPLER_RELEASE_DATE RandomDate('01-JAN-2000', sysdate)

Note: For mapping expressions, you can refer to the P3-1.txt file located in the C:\Labs\Files\Text folder.

Your Target datastore should look as follows:

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 73: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 29

e. Click the Flow tab. Click the Target datastore. In the Target Properties, view and accept the default values of the options. Click the Save icon to save the interface.

f. Click the Execute button to execute your interface. Click OK. Click OK again.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 74: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 30

g. Click the Operator tab. Expand All executions as shown in the following and verify that the interface is executed successfully.

.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 75: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 31

h. Click the Designer tab. On the Models tab, in the Oracle_RDBMS1 folder, right-click Sales_Sampler datastore and select View data.

Verify that your target datastore is now populated with randomly generated data.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 76: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Developing Knowledge Modules

Chapter 3 - Page 32

i. Close ODI Studio. If open, close SQL Developer.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 77: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 1

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 78: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 2

Practices for Lesson 4: Overview

Practices Overview In Practice 4-1, you perform the steps to build an ODI interface that will load an XML file with a constraint to the database table. The constraint will only allow data to be loaded where client age is >= 21. Any rows that do not pass the constraint will be loaded to the error table on the target database – E_CLIENT.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 79: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 3

Practice 4-1: Creating an ODI Interface for XML to Database Transformation with ODI Constraint and Error Recycling

Overview

In this practice, you perform the following steps:

1. Create a new model for the RDBMS table CLIENT. Define the constraint for the table.

2. Import appropriate Load Knowledge Modules (LKM), Integrate Knowledge Modules (IKM), and Check Knowledge Modules (CKM) into the project.

3. Create an integration interface for transformation from XML to RDBMS model. You enable the CKM and error recycling.

4. Test your interface and verify data.

Your Tasks

1. Reset your practice environment.

a. Verify that ODI Studio and SQL developer are closed. If they are running, close ODI Studio and SQL Developer.

b. If necessary, start the command utility and change directory to the following folder: C:\Labs\ResetPractice\reset_4. Execute the following command: resetRepo.bat. Press any key when prompted. Verify that this command executed successfully.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 80: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 4

2. Connect to ODI Studio and create a new model for the RDBMS table CLIENT:

Connect to the DEV_ODI_REPO Work Repository (User: SUPERVISOR, Password: SUNOPSIS). Click the Designer tab.

a. Open the Designer tab, then open the Models tab. Click New Model Folder and select

New Model. For model name, enter Oracle_TRG. Set Technology to Oracle. Use the existing logical schema ODI_STAGE. Click the Reverse Engineer tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 81: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 5

b. For Context, choose Development. Retain the other default settings. Save your model and close the editor.

c. Create the CLIENT datastore within the Oracle_TRG model by copying from the XML

model. Select and expand the XML_SRC model. Right-click the CLIENT table and select Duplicate Selection. Click Yes in the Confirmation dialog box.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 82: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 6

d. Drag the new duplicate “Copy of CLIENT” from the XML_SRC model to the Oracle_TRG model. Expand the Oracle_TRG model and double-click the “Copy of CLIENT” datastore to edit. Change the name to CLIENT. Click Save and close the editor. Note: No physical table is created on Oracle_TRG. When the Interface is run, it creates the CLIENT physical table.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 83: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 7

e. During the duplication of the CLIENT datastore, the constraint for the XML file was also copied. This constraint should be deleted. Expand Oracle_TRG > CLIENT > Constraints. Right-click the CITY_CLIENT CITY constraint and click Delete.

f. You need to set up a new constraint for the CLIENT table in the RDBMS datastore

CLIENT. To set up the ODI constraint on the CLIENT data store in Oracle_TRG model, right-click Constraints and select New Condition. Specify the parameters of the new constraint as shown in the table below. Save this constraint and close the editor.

Parameter Value

Name AgeConstraint

Type Oracle Data Integrator Condition

Where cast(Client.age as numeric)>=21

Message Client must be at least 21 years old

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 84: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 8

Note: On first execution of the interface, the SQL will not validate until the table is created.

3. Before the interface is created, the Load Knowledge Modules (LKM), Integrate Knowledge Modules (IKM), and Check Knowledge Modules (CKM) need to be imported into the project. To import these KMs, perform the following steps: a. Open the Projects tab and expand the Knowledge Modules node. Right-click the

Loading (LKM) node and select Import Knowledge Modules. If not open, browse to the C:\Oracle\Middleware\Oracle_ODI1\oracledi\xml-reference folder. Select LKM SQL to Oracle. Click OK. Close the Import Report window.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 85: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 9

b. Similarly, select the Integration (IKM) node and import IKM SQL Control Append

Knowledge module. Select the Integration (IKM) node and import IKM SQL Control Append. Knowledge module. Expand Check (CKM) node and import CKM Oracle. Refer to the screenshots below.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 86: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 10

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 87: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 11

c. Create a new interface INT_LOAD_TBL_CLIENT. Set the Optimization context to

Development, and then click the Mapping tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 88: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 12

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 89: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 13

d. Open the Models tab to drag the source and target to the interface. Drag the Client datastore from XML_SRC model into the Sources container. Drag the Client datastore from Oracle_TRG into the Target container. When Designer asks “Do you want to perform Automatic Mapping?” click Yes.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 90: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 14

e. Select the CLIENT_ID column in Target Datastore. Scroll down the Target Column Properties section and select the Key box to set the CLIENT_ID column to be the key. Click the Flow tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 91: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 15

f. Click SRCSet0 (XML_GEO_DIM) and set the LKM option to LKM SQL to Oracle.

g. Similarly, select Target (ODI_STAGE). Set the IKM for Target to IKM SQL Control

Append. Set Options as provided in the following table. Click the Controls tab.

Option Value

RECYCLE_ERRORS true

CREATE_TARG_TABLE true

DELETE_ALL true

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 92: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 16

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 93: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 17

h. On the Controls tab, leave the default values as shown on the screenshot. Click the save icon to save your interface.

4. To execute and test your interface, perform the following steps:

a. Click the Execute button . Leave the execution settings as default. Click OK. When the Information dialog box indicates that the session started, click OK.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 94: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 18

b. Open the Operator tab, expand All Executions, and then expand your session as shown in the screenshot. Verify that the interface executed successfully:

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 95: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 19

5. To check data and recycled errors, perform the following steps:

a. Open Designer > Models tab. Right-click the source datastore CLIENT in XML_SRC model and select View Data. Note that some clients have value for AGE less than 21 years old. These rows should not pass the constraint recycled in the error table.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 96: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 20

b. View data in the target datastore CLIENT in Oracle_TRG model. There are no records for customers younger than 21 years old. These records did not pass the constraint.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 97: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 21

c. Right-click the CLIENT datastore in Oracle_TRG model, and select Control > Errors. View recycled errors in your error table.

d. Close ODI Studio. If open, close SQL Developer.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 98: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Designing ODI Integration Interfaces

Chapter 4 - Page 22

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 99: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 1

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 100: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 2

Practices for Lesson 5: Overview

Practices Overview In Practice 5-1, you create a temporary ODI interface for data transformation. You also create another interface, which uses your newly created temporary interface as a source for transformation. After that, you modify your interface to enable it to process data from multiple datasets.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 101: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 3

Practice 5-1: Implementing ODI Integration with Temporary Interfaces

Overview In this practice, you perform the following steps:

1. Create a temporary interface, INT-TEMP_AGG_ORDERS.

• Use datastores SRC_ORDERS and SRC_ORDER_LINES from the HSQL_SRC model, joined on ORDER_ID.

• Use SRC_CUSTOMER as a lookup table.

• Create a temporary target table, TEMP_AGG_ORDERS.

• Aggregate some of its columns by using the MIN, MAX, and AVG functions.

2. Create the interface INT-TRG_SALES.

• Use the temporary interface INT-TEMP_AGG_ORDERS as a source.

• Use the datastore TRG_SALES as the target.

3. Execute INT-TRG_SALES and examine the rows inserted into TRG_SALES.

4. Create and test the new interface that loads data into the TRG_BULK_SALES table from multiple datasets using the UNION operator.

Your Tasks

1. Reset your practice environment.

a. Verify that ODI Studio and SQL developer are closed. If they are running, close ODI Studio and SQL Developer.

b. If necessary, start the command utility and change directory to the following folder: C:\Labs\ResetPractice\reset_5. Execute the command: resetRepo.bat. Press any key when prompted. Verify that this command executed successfully.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 102: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 4

2. Develop an ODI Temporary interface.

a. If not connected, connect to the DEV_ODI_REPO Work Repository (User: SUPERVISOR, Password: SUNOPSIS). Click the Designer tab.

b. On the Projects tab, expand: Loads > HandsOn. Right-click Interfaces, and then

select New Interface. Name the new interface INT-TEMP_AGG_ORDERS. In the Optimization Context field, select Development. For Staging Area, select Hypersonic SQL: HSQL_DEMO_SRC. Click the Mapping tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 103: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 5

c. Open the Models tab. Expand the HSQL_SRC model, and drag SRC_ORDERS and SRC_ORDER_LINES datastores from the model to the Source area.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 104: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 6

d. Drag the ORDER_ID column from the SRC_ORDERS datastore to the ORDER_ID column in the SRC_ORDER_LINES datastore to create a Join. Select the Join icon. Close the Messages - Log tab and view the Join properties.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 105: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 7

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 106: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 8

e. Click the Lookup icon to start the Lookup Wizard . Ensure that your selected Driving table is SRC_ORDERS. In the Lookup Table window, expand HSQL_SRC model. Select the Lookup table, SRC_CUSTOMER, in the HSQL_SRC model. For the Lookup table, edit the Alias to read: LKUP_SRC_CUSTOMER as shown in the following screen. Click Next.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 107: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 9

f. Select the CUST_ID column in the Source table and the CUSTID column in the Lookup table, as shown in the following screen, and then click Join. Click Finish.

g. Now, you need to create a temporary target datastore. Drag the column CUST_ID from

the SRC_ORDERS table to the Target area. Click <Temporary Target DataStore>. In the Temporary Target Properties, enter Name: TEMP_AGG_ORDERS, as shown in the following screenshots:

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 108: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 10

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 109: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 11

h. Drag the column ORDER_ID from SRC_ORDERS to the Target area. Then click this SRC_ORDERS.ORDER_ID column in the target datastore. Select this column, and in the Mapping Properties panel at the bottom of the window, edit the Implementation tab to read: MIN(SRC_ORDERS.ORDER_ID). Scroll down to the Target Column Properties section and rename this column to FIRST_ORDER_ID. Scroll back up the Property Inspector, click the ORDER_ID column in Target Datastore and examine your results thus far.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 110: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 12

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 111: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 13

i. Again, drag the column Order_ID from SRC_ORDERS to the Target area. In the Mapping Properties panel at the bottom of the window, edit the Implementation tab to read: MAX(SRC_ORDERS.ORDER_ID). Scroll down and rename this column LAST_ORDER_ID.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 112: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 14

j. Drag the column ORDER_DATE from SRC_ORDERS to the Target area. In the Mapping Properties panel at the bottom of the window, edit the Implementation tab to read: MIN(SRC_ORDERS.ORDER_DATE). Scroll down and rename this column FIRST_ORDER_DATE.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 113: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 15

k. Similarly, drag the column ORDER_DATE again from SRC_ORDERS to the Target area. Edit the mapping properties to read MAX(SRC_ORDERS.ORDER_DATE). Scroll down and rename this column LAST_ORDER_DATE.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 114: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 16

l. In the Source area, expand the lookup datastore by clicking the plus sign in the upper-left corner of the lookup datastore, and then stretching the datastore longer until you see all of its columns. Drag the FIRST_NAME column from the lookup table to the Target area. In the Target area, click the FIRST_NAME column. Start the Expression

editor , and then drag the LAST_NAME column from the left panel of the Expression Editor to the “expression” area.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 115: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 17

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 116: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 18

m. Edit the expression to read LKUP_SRC_CUSTOMER.FIRST_NAME || ‘ ‘ || LKUP_SRC_CUSTOMER.LAST_NAME, as shown next. Click OK. In the Mapping

Properties section, click the button to validate the expression. An ODI Information message indicates that the SQL expression is valid. Click OK.

Note: You can find this expression in the file: C:\Labs\Files\Text\P5-1.txt

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 117: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 19

n. Scroll down, and in the Target Column Properties, rename this column CUST_NAME.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 118: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 20

o. Drag the column QTY from the SRC_ORDER_LINES source datastore to the Target area. Edit the mapping expression to read SUM(SRC_ORDER_LINES.QTY).

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 119: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 21

p. Drag the column AMOUNT from the SRC_ORDER_LINES source datastore to the Target area. Edit the mapping expression to read AVG(SRC_ORDER_LINES.AMOUNT). In the Target Column Properties, rename this column AVG_AMOUNT.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 120: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 22

q. Drag the column AMOUNT again from the SRC_ORDER_LINES source datastore to the Target area. Edit the mapping expression to read SUM(SRC_ORDER_LINES.AMOUNT). Rename this column SUM_AMOUNT.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 121: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 23

r. Drag the column PRODUCT_ID from the SRC_ORDER_LINES source datastore to the Target area.

s. In the Target datastore, click the SUM_AMOUNT column. In the Execute on section,

select Staging Area. Repeat this step for the six other target columns in which you defined a function in the mapping expression. Refer to the following table to verify the execution location. Your Target datastore should now look as shown in the screen.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 122: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 24

Column Execution Location

SUM_AMOUNT Staging Area

AVG_AMOUNT Staging Area

CUST_ID Source

CUST_NAME Source

FIRST_ORDER_DATE Staging Area

FIRST_ORDER_ID Staging Area

LAST_ORDER_DATE Staging Area

LAST_ORDER_ID Staging Area

PRODUCT_ID Source

QTY Staging Area

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 123: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 25

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 124: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 26

t. Click the Flow tab. Verify the flow, and then click the Save button to save your temporary interface. Verify that your temporary interface appeared in the tree view. Close your interface tab.

Note the yellow color of your newly created temporary interface in the Designer Navigator’s Projects tree view.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 125: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 27

3. Create a new interface, which uses the newly created temporary interface as a source. a. In the Loads project, create a new ODI interface, INT-TRG_SALES, as shown next. In

the Optimization Context field, select Development. Open the Mapping tab.

b. Drag the temporary interface, INT-TEMP_AGG_ORDERS, from the Projects tab to the

Source area.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 126: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 28

c. On the Models tab, expand Oracle Sales Application model, and drag the datastore TRG_SALES from the Oracle Sales Application model to the Target Datastore area. Click Yes to perform automatic mapping. Note that only three of the nine columns were automatically mapped.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 127: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 29

d. In the Target Datastore, select the FIRST_ORD_DATE column, and then drag the FIRST_ORDER_DATE column from the temporary interface in the source area to the Implementation tab in the Mapping Properties area as shown below.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 128: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 30

e. Repeat the previous two-step process to map the remaining target columns to their corresponding columns in the temporary interface in the Source area. Use the following table and results’ screen as your guide:

First click this column in the Target Datastore TRG_SALES:

Then drag this column from the Source area down to the Implementation tab:

FIRST_ORD_ID FIRST_ORDER_ID

LAST_ORD_ID LAST_ORDER_ID

LAST_ORD_DATE LAST_ORDER_DATE

AMOUNT SUM_AMOUNT

PROD_AVG_PRICE AVG_AMOUNT

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 129: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 31

f. In the Source panel, click INT-TEMP_AGG_ORDERS, scroll down to the Source Properties section, and then select the Use Temporary Interface as Derived Table (Sub-Select) check box.

g. To view data derived from the temporary interface, right-click the temporary interface

and select Data. Close the Data Editor window.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 130: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 32

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 131: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 33

h. Click the Flow tab, click Target Datastore, and verify the flow of your interface. In the Target Properties, set the DELETE_ALL option to “true”. Save the interface, and then close the interface tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 132: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 34

4. Execute the interface INT-TRG_SALES and verify the execution results.

a. Execute the interface INT-TRG_SALES.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 133: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 35

b. Open ODI Operator Navigator and verify that the interface INT-TRG_SALES executed successfully. Scroll down and open the task Integration - INT-TRG_SALES - Insert new rows (step 35). Verify the number of inserts.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 134: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 36

c. In the Models tab in the Oracle Sales Application model, right-click the TRG_SALES datastore, and select View Data. View the rows inserted in the target datastore.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 135: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 37

5. Create a new interface that loads data into the TRG_BULK_SALES table from multiple datasets using UNION operator.

a. In Designer navigator, right-click Interfaces to create a new interface. Name this interface INT-TRG_BULK_SALES. Open the Mapping tab.

Note: This interface will load TRG_BULK_SALES datastore with data from two datasets – the default dataset from the temporary interface INT-TEMP_AGG_ORDERS and another dataset from the TRG_BULK_SALES datastore.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 136: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 38

b. Drag the temporary interface, INT-TEMP_AGG_ORDERS, from the Projects tab to the Source area.

c. From the Models tab, drag the datastore TRG_BULK_SALES from the Oracle Sales

Application model to the Target Datastore area. Click Yes to perform automatic mapping. Note that only three of the nine columns were automatically mapped. Map other columns as described in steps 3 d and 3 e.

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 137: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 39

d. In the Source panel, click INT-TEMP_AGG_ORDERS, scroll down to the Source

Properties section, and then select the Use Temporary Interface as Derived Table (Sub-Select) check box.

e. Click the “Add/Remove DataSet” icon , and then click the “Add new DataSet”

icon .

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 138: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 40

f. Enter the new dataset name: BULK_SALES. Select Operator: UNION. Close the Datasets Configuration window.

g. On the Mapping tab, select the BULK_SALES dataset tab. In the Design navigator

Models tab, drag the SRC_BULK_SALES datastore from the Oracle Sales Application to the Source area of the interface. Click Yes to perform automatic mapping.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 139: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 41

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 140: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 42

h. Open the Flow tab and verify the flow of your interface. Click the target datastore. Ensure that the FLOW_CONTROL option is set to “false” and the DELETE_ALL option is set to “true,” as shown in the following screenshot.

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 141: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 43

i. Open the Mapping tab again, click the BULK_SALES tab, and then save the interface.

j. Click the Execute button . In the Execution dialog box, select the Simulation check box to perform an execution simulation in the Development context. Click OK. In the Simulation window, scroll down to approximately one third of the way, and view the simulated code for the dataset TRG_BULK_SALES with the UNION operator as shown next.

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 142: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 44

6. Execute interface INT-TRG_BULK_SALES (do not select the Simulation check box) and

verify the execution results.

a. Execute the interface.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 143: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 45

b. Open the Operator. Verify that the session INT-TRG_BULK_SALES executed

successfully. Scroll down and open the task Integration – INT-TRG_BULK_SALES - Insert new rows (step 15). Verify the number of inserts in the target table. Note that the result set is now combining data from both datasets as a result of UNION operator. Close the Session task.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 144: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 46

c. Open the Designer. In Oracle Sales Application, Right-click the TRG_BULK_SALES

datastore and select View Data. Verify that this datastore is now populated with combined data from the temporary interface INT-TEMP_AGG_ORDERS and SRC_BULK_SALES datastore as a result of the UNION operator.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 145: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 47

d. Close ODI Studio. If open, close SQL Developer.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 146: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Designing Advanced Integration Interfaces

Chapter 5 - Page 48

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 147: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 1

Practices for Lesson 6: Using Variables in ODI

Chapter 6

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 148: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 2

Practices for Lesson 6: Overview

Practices Overview In Practice 6-1, you create an ODI procedure and a package with variables to control execution of the workflow with integration interfaces. The interfaces have been predefined for the purpose of this practice.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 149: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 3

Practice 6-1: Using Variables in ODI Package

Overview

In this practice, you create a package for executing the number of interfaces and the procedure for deleting records from the target tables. You define ODI variables that are used to control the flow in the package.

You create the procedure PRD_CLEAR_TRG to delete records in the datastores TRG_SALES and TRG_PRODUCT before running the interfaces INT_TRG_PROD_FAMILY and INT_TRG_PRODUCT, which load the target tables TRG_PROD_FAMILY and TRG_PRODUCT located in the Oracle Sales Application model. To organize the appropriate workflow, you create the package PKG_LOAD_PRODUCT. The procedure PRD_CLEAR_TRG should be executed in the package before running the interfaces to ensure that referential integrity is not violated.

You create numeric variable FLAG to count the number of records in the TRG_PRODUCT datastore. Only when the value of this variable is greater than 0, then the procedure PRD_CLEAR_TRG is executed in the workflow.

Your Tasks

1. Reset your practice environment.

a. Verify that ODI Studio and SQL Developer are closed. If they are running, close ODI Studio and SQL Developer.

b. If necessary, start the command utility. Change directory to the following folder: C:\Labs\ResetPractice\reset_6. Execute the command: resetRepo.bat. Press any key when prompted. Verify that this command executed successfully.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 150: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 4

2. Create the PRD_CLEAR_TRG procedure that deletes data in the TRG_SALES and TRG_PRODUCT tables in the Oracle sales Application model.

a. If not open, log in to DEV_ODI_REPO and enter SUPERVISOR for the username and SUNOPSIS for the password.

b. On the Designer tab, click the Projects tab, and then select the Procedures node from

the Loads > HandsOn folder. Right-click the Procedures node and select the New Procedure option.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 151: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 5

c. Enter PRD_CLEAR_TRG in the Name field, and select Oracle as the Target

Technology. Click the Details tab, and then click the Add icon .

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 152: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 6

d. In the Name Field, enter DELETE TRG_SALES. You edit fields in the Command on Target tab. In the Schema field, select ORACLE_ORCL_LOCAL_SALES. In the Context field, select Development. In the Command field, enter the following statement: DELETE FROM <%=odiRef.getObjectName("L", "TRG_SALES", "ORACLE_ORCL_LOCAL_SALES", "", "D") %>

Note: For this and other commands used in this practice, refer to the file: C:\Labs\Files\Text\P6-1.txt

You use the substitution method odiRef.getObjectName, which returns the table name with run-time-dependent information, such as the Oracle schema name that may vary depending on the context and topology. Select the Ignore Errors check box. Click the Details tab.

e. Click the Add icon. In the Name Field, enter DELETE TRG_PRODUCT. In the Schema

field, select ORACLE_ORCL_LOCAL_SALES. In the Context field, select Development.

In the Command field, enter the following code: DELETE FROM <%=odiRef.getObjectName("L", "TRG_PRODUCT", "ORACLE_ORCL_LOCAL_SALES", "", "D") %>

Select the Ignore Errors check box. Click the Details tab, save the procedure and close the editor.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 153: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 7

3. Create a package, PKG_LOAD_PRODUCT, which runs:

1. The PRD_CLEAR_TRG procedure

2. The INT_TRG_PROD_FAMILY

3. The INT_TRG_PRODUCT Note: These interfaces were precreated for the purpose of this practice.

a. On the Projects tab of the Designer Navigator, expand the Loads > HandsOn folder. Right-click the Packages node and select the New Package option.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 154: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 8

b. Enter PKG_LOAD_PRODUCT in the Name field, and then click the Diagram tab. In the Designer navigator tree view, expand the Interfaces node and Procedures node. Select the PRD_CLEAR_TRG procedure from the tree view, and then drag it to the diagram workbench. The step appears in the package.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 155: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 9

c. Repeat the operation for the INT_TRG_PROD_FAMILY and INT_TRG_PRODUCT interfaces. The package should appear as follows:

d. Rename your steps with the names of the tables loaded by the step. In the Diagram window, click the step for the PRD_CLEAR_TRG procedure. Edit the Step name: CLEAR TARGET TABLES, as shown in the following screenshot. In the diagram, click the step again. The step is now renamed CLEAR TARGET TABLES.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 156: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 10

e. Similarly edit the names of the other steps in the diagram, as follows:

Rename INT_TRG_PROD_FAMILY step as LOAD PRODUCT FAMILY and the INT_TRG_PRODUCT step as LOAD PRODUCT.

f. Click the Step After Success tool icon on the Package toolbar. Click the CLEAR TARGET TABLES step. Press and hold the left mouse button and move the cursor over the LOAD PRODUCT FAMILY step. Then release the mouse button. A green arrow appears between these steps. Repeat the same operation to connect LOAD PRODUCT FAMILY step with LOAD PRODUCT step as shown below. When

completed, click the Free Choice tool icon . That will cancel the “Next Step in Success” mode. Click Save button to save this package.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 157: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 11

4. Run this package and review its execution in ODI Operator.

a. Click the Execute package button to run this package. Click OK in the Execution window that appears, and then click OK again.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 158: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 12

b. In the Operator Navigator, click the Refresh icon. In the session list, expand the All Executions node. The session called PKG_LOAD_PRODUCT should appear as complete. You can expand the nodes in the session to see the steps and tasks corresponding to your procedure commands and the interfaces that have been executed.

5. Create a numeric variable called FLAG that counts the number of lines in TRG_PRODUCT. This variable will control the execution of the procedure CLEAR TARGET TABLES. Only when the table TRG_PRODUCT has some records, the procedure will be executed and records in the tables TRG_SALES and TRG_PRODUCT will be deleted.

a. In the Designer, open the Projects tab, and select the Variables node in the HandsOnLoads project. Right-click this node and then select New Variable.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 159: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 13

b. Enter FLAG in the Name field, select Numeric as the Datatype, and enter 0 in the Default Value field. In the Keep History field, select All Values to enable viewing the history of all values for this variable.

c. Click the Refreshing tab. Select ORACLE_ORCL_LOCAL_SALES as the schema, and in

the Select Query field, enter the following expression. Click the Save button to save the variable. Close the FLAG variable tab.

SELECT COUNT(*) FROM <%=odiRef.getObjectName("L", "TRG_PRODUCT", "ORACLE_ORCL_LOCAL_SALES", "", "D") %>

6. Modify a package to have the CLEAR TARGET TABLES step running only if FLAG is greater than 0.

a. Click the Diagram tab. In the project tree, expand the Variables node. Drag the FLAG variable from the tree view to the diagram. Click the FLAG step in the diagram. In the Properties > General tab beneath the diagram, rename this step Refresh Customer Count. Ensure that the Type field is set to the Refresh variable.

Note: You need to click the step in the diagram to view the new step name.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 160: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 14

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 161: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 15

b. Drag the FLAG variable from the tree view to the diagram again. Rename this step Flag > 0?, change the Type to Evaluate Variable. In the Operator field, select “>” as the operator, and enter 0 in the Value field.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 162: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 16

c. Right-click the Refresh Count product step and select First Step. Click the “Next step

on success” tool on the Package toolbar, and link the step Refresh Customer

Count to the step Flag >0? Using the same tool, link the step Flag > 0? to the step

CLEAR TARGET TABLES. Click the “Next step on failure” tool on the Package

toolbar, and link the step Flag > 0? to the LOAD PRODUCT FAMILY step, as shown

below. Click Save to save the package. Close the tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 163: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 17

7. Run the new package and check if the Clear Target Tables step was executed.

a. Right-click the package PKG_LOAD_PRODUCT, and then select Execute. Click OK in the Execution window, and then click OK when the “Session started” message appears.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 164: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 18

b. In the Operator, verify that the latest session called PKG_14-2 appears as complete, with a Delete Target Tables step executed.

c. Open the Designer tab. If necessary, open the package PKG_LOAD_PRODUCT

again, and then click the Diagram tab. To delete records from the target tables, select the CLEAR TARGET TABLES step, right-click, and select Execute Step. Click OK in the Execution window, and then click OK when the “Session started” message appears.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 165: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 19

d. In the Operator, verify that the latest session called CLEAR TARGET TABLES appears

as complete, with the CLEAR TARGET TABLES step executed.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 166: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 20

e. Now, with records from the target tables having been deleted, execute the entire package PKG_LOAD_PRODUCT again. Click OK in the Execution window, and then click OK when the “Session started” message appears.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 167: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 21

f. Open the Operator and expand the latest session called PKG_LOAD_PRODUCT. Verify that the Delete Target Tables step is no longer executed. Because the Product table was emptied by the execution of the CLEAR TARGET TABLES step, the value of variable FLAG >0? changes when refreshed, to “false”, and the CLEAR TARGET TABLES step is no longer executed. Close the PKG_LOAD_PRODUCT tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 168: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 22

Practice 6-2: Using an ODI Variable as a Startup Parameter

Overview In some integration projects, a flat file needs to be exported into a relational table. In this practice, you create the global variable FileName. Its value is used as a dynamic name of a flat file, which is to be exported to a relational database table. To reference the flat file dynamically, you edit the source datastore to point to the variable rather than having the resource file name hardcoded. You create an interface to export a flat file to a relational table, and then create a package with the variable and the interface. From the package, you generate a scenario. The actual name of the flat file to be loaded into the relational table will be defined as a startup parameter when your scenario is executed.

Your Tasks

1. Create and edit the flat file.

a. Open the folder: C:\Labs\Files\Flat_files. Create a copy of the file SRC_SALES_PERSON.txt as shown below. Rename the new file: SRC_SALES_PERSON1.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 169: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 23

b. Open the file SRC_SALES_PERSON1 with WordPad. Edit the file by deleting the last record. Save and close the file.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 170: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 24

2. Create a global variable FileName.

a. In Designer, open Global Objects accordion. Right-click Global_Variables, and then select New Variable. In the Name field, enter FileName. The Datatype field should be set to Alphanumeric. In the Keep History field, select Latest value. For now, leave this tab open. You will continue to edit it in a couple steps.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 171: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 25

b. Default value is recommended for the variable. Its value depends on how the location of the resource file is defined in the physical schema. Open Topology > Physical Architecture > Technologies > File > FILE_GENERIC. Double-click the default physical schema FILE_GENERIC.C:\Labs\Files\Flat_files. Verify that a path to the folder containing your flat files is defined in the Directory fields as shown below. Because this path to the folder is specified in the schema, you do not have to include it in the Default Value field for the variable; you just need to specify the file name. Close the FILE_GENERIC.C\Labs\Files\Flat_files tab.

c. Return to the FileName variable tab. In the Default Value field, enter

SRC_SALES_PERSON.txt. Save and close the FileName variable tab.

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 172: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 26

3. Edit the source datastore to point to your variable FileName as a resource name.

a. Open the Models tab. Expand Flat_File_1 model. Double-click SRC_SALES_PERSON(SRC_SALES_PERSON.txt) datastore to edit it.

b. Open the Models tab. Expand Flat_File_1 model. Double-click

SRC_SALES_PERSON(SRC_SALES_PERSON.txt) datastore to edit it. Instead of the hard-coded value, refer to your variable in the Resource Name field: #FileName, as shown below. Save and close the tab. Note that the name of the datastore node in the tree changed to SRC_SALES_PERSON(#FileName).

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 173: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 27

4. Create an interface to load the flat file into a relational database table.

a. Open the Projects tab. Expand Export Files > First Folder > Interfaces. Right-click Interfaces and then select New Interface. In the Name field, enter INT-TRG_SALES_PERSON_1. Click the Mapping tab.

b. Select and drag the datastore SRC_SALES_PERSON(#FileName) to the Source

panel of the interface editor.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 174: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 28

c. Expand the Oracle_RDBMS1 model. Select and drag the TRG_SALES_PERSON target datastore to the Target panel of the interface editor. In the Automap dialog box, click Yes to perform automatic mapping.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 175: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 29

d. Select the DATE_UPDATED column in the Target Datastore. In the Implementation tab, enter SYSDATE. In the Execute On section, select the Staging Area option. Click the Flow tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 176: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 30

e. In the Flow tab, select the source datastore SrcSet0(FILE_GENERIC). Verify and accept the default settings. Click Target (ODI_STAGE). In IKM Selector, select IKM SQL Incremental Update. In the Options section:

• For FLOW_CONTROL select false

• For DELETE_ALL select true

Save the INT-TRG_SALES_PERSON_1 interface and close the tab.

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 177: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 31

5. Create the new package.

a. In the Projects tab, expand Export Files > First Folder > Packages. Right-click Packages and then select New Package. In the Name field, enter PKG-TRG_SALES_PERSON_1. Click the Diagram tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 178: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 32

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 179: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 33

b. Select the global variable FileName and then drag it to the diagram as shown below.

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 180: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 34

c. Select the interface INT-TRG_SALES_PERSON_1 and drag it to the diagram. Select

Next Step on Success (OK) icon . Click the variable step FileName and connect it

to the interface step INT-TRG_SALES_PERSON_1. When done, click the Free choice

icon .

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 181: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 35

d. Click the variable step FileName to select it. In the Type field, select Declare Variable. Save and close the PKG-TRG_SALES_PERSON_1 tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 182: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 36

e. To test your package, right-click the package PKG-TRG_SALES_PERSON_1 and select

Execute. Click OK in the Execution and Information dialog boxes.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 183: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 37

Open the Operator tab and verify that your package executed successfully.

Note: You may need to click the Refresh icon .

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 184: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 38

6. Generate the scenario with the NameFile global variable as a startup parameter.

a. In the Projects tab, right-click the package PKG-TRG_SALES_PERSON_1. Select Generate Scenario. Click OK. In the Scenario Variables window, accept the default settings and click OK.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 185: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 39

b. To execute the scenario, expand Load Plans and Scenarios accordion. Right-click your scenario and select Execute. Click OK. The Variable values window is displayed with the default value of your variable.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 186: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 40

c. In the Variable values window, deselect the Last value check box. In the Value field,

enter the name of the file you edited: SRC_SALES_PERSON1.txt. Click OK. Click OK again.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 187: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 41

d. Open the Operator tab. Click the Refresh icon . Verify that your scenario is executed successfully.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 188: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using Variables in ODI

Chapter 6 - Page 42

e. Now, you can check the data inserted in the target datastore. Open the Models tab. In the model Oracle_RDBMS_1, right-click the TRG_SALES_PERSON datastore and select View Data. View and verify your data.

f. Close ODI Studio. If open, close SQL Developer.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 189: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 1

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 190: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 2

Practices for Lesson 7: Overview

Practices Overview

One of the great features in Oracle Data Integrator 11.1.1.6 is the integration of the scripting language Groovy within the ODI user interface. In this practice, you explore how to create an ODI project, topology, model, and an interface with Groovy.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 191: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 3

Practice 7-1: Automating ODI Tasks with Groovy

Overview

In this practice, you perform the following steps:

1. Create ODI project with Groovy script.

2. Create a topology and a new model with Groovy script.

3. Create ODI integration interface with Groovy.

Your Tasks

1. Reset your practice environment.

a. Verify that ODI Studio and SQL Developer are closed. If they are running, close ODI Studio and SQL Developer.

b. If necessary, start the command utility. Change directory to the following folder: C:\Labs\ResetPractice\reset_7. Execute the command: resetRepo.bat. Press any key when prompted. Verify that this command executed successfully.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 192: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 4

2. Create an ODI project with Groovy script.

a. If not open, log in to ODI Studio as user SUPERVISOR with password SUNOPSIS.

b. Groovy can be executed by executing a script. You can create a new one or open an

existing Groovy script. To create a new Groovy script, select Tools > Groovy > New Script.

c. You should see a new Groovy window appear in the IDE. Also, note that the green

Execute button is enabled on the toolbar.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 193: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 5

d. Navigate to the following folder: C:\Labs\Files\Text, and open the text file Create_Project_sample.txt:

import oracle.odi.core.persistence.transaction.support.DefaultTransactionDefinition;

import oracle.odi.domain.project.OdiProject;

import oracle.odi.domain.project.OdiFolder;

def createProject(projectName, projectCode, folderName)

{

txnDef = new DefaultTransactionDefinition();

tm = odiInstance.getTransactionManager()

txnStatus = tm.getTransaction(txnDef)

project = new OdiProject(projectName, projectCode)

folder = new OdiFolder(project, folderName)

odiInstance.getTransactionalEntityManager().persist(project)

tm.commit(txnStatus)

}

createProject("<Project Name>", "<Code>", "<Folder Name>")

e. In the script, enter the values for parameters of Project Name, Project Code , and Folder Name parameters, as shown below:

Parameter Value

Project Name DATA WAREHOUSING

Code EDW

Folder Name INITIALIZATION

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 194: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 6

f. Click the Execute button to execute this Groovy script. Verify that the script is executed.

g. Open the Designer, and view your newly created Project. Expand

DATAWAREHOUSING > INITIALIZATION nodes and explore other nodes created in this project tree.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 195: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 7

h. Click the Save ALL button to save your Groovy script. Navigate to the c:\Labs folder, and create and open a new folder named Groovy. Name your Groovy script: Create_Project_Warehousing. Close the Groovy editor.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 196: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 8

3. Create a new model and topology for using the Groovy script.

a. Note the following methods and their parameters that you will use to create the model and the topology:

createLogicalSchema:

contextCode: The ODI code for the context used to map the logical schema to the physical

technologyCode: The ODI code for the technology

nameForLogicalSchema: The name for the logical schema to create

NameForDataserver: The name for the data server to create

userNameForAuthentication: The username for the connection to the data server

passwordForAuthentication: The password for the connection to the data server

urlForAuthentication: The URL for the connection to the data server

driverForAuthentication: The JDBC driver for the connection to the data server

schemaForAuthentication: The schema to use for the ODI physical schema createModel:

logicalSchemaObject: The ODI logical schema object (instance of ODILogicalSchema)

contextCode: The ODI context code for reverse engineering

nameForModel: The name for the model to create

codeForModel: The code for the model to create

Note: With these two methods or variations of them, you can easily construct your topology objects and models. You will create a new model named ORACLE_WH and all of the topology objects that will allow going straight to reverse engineering when the script has been run.

To create the topology, enter: lschema = createLogicalSchema("<Context>", "<Technology>",

"<Logical Schema Name>", "<Data Server Name>", "<Database User Name>",

ObfuscatedString.obfuscate("<Database User Password>"), "<URL>", "<Driver>", "<DB Schema used for ODI Physical Schema>")

In this example, you use the following parameters: lschema = createLogicalSchema("GLOBAL", "ORACLE", "ORACLE_EBS",

"ORACLE_HQ_DEV", "ODI", ObfuscatedString.obfuscate("ODI"), "jdbc:oracle:thin:@localhost:1521:orcl", "oracle.jdbc.OracleDriver", "ODI")

To create a model, enter: createModel(lschema, "<Context>", "<Model Name>", "<Model Code>")

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 197: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 9

In this example, you use the following parameters: createModel(lschema, "GLOBAL", "ORACLE_WH", "ORACLE_WH")

b. Navigate to the C:\Labs\Files\Text folder and open the text file Create_Model-Topology_sample.txt. Edit the last two statements of file by inserting the appropriate parameters. Refer to the table below.

Note: If you do not have enough time, you can also use a preconfigured file Create_Model-Topology from the same folder: C:\Labs\Files\Text.

Topology

Parameter Value

Context GLOBAL

Technology ORACLE

Logical Schema Name

ORACLE_EBS

Data Server Name

ORACLE_HQ_DEV

Database User Name

ODI

Database User Password

ODI

URL jdbc:oracle:thin:@localhost:1521:orcl

Driver oracle.jdbc.OracleDriver

Schema used for ODI Physical Schema

ODI

Model

Parameter Value

Context GLOBAL

Model Name

ORACLE_WH

Model Code

ORACLE_WH

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 198: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 10

c. Copy the configured file into the Groovy editor and execute the script. Verify that the script executed successfully.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 199: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 11

d. Open the model tab and verify that your ORACLE_WH model has been created. Right-click the ORACLE_WH model and select Reverse Engineer. View the datastore.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 200: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 12

e. Open the Topology tab. In Physical Architecture, expand Oracle Technology and find your newly created Data server and Physical Schema.

.

f. Click the Save button and save your new Groovy script in the C:\Labs\Groovy folder. Name your Groovy script Create_Model_Topology_Warehousing. Close your Groovy editor.

4. Create a new ODI interface using Groovy script. The following Groovy script creates a simple interface, which performs data transformation from the source datastore to the target datastore.

Note: You will create this interface with the default knowledge modules and the context (Global).

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 201: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 13

a. Open the Global Objects tab and expand the Global Knowledge Modules node. Import the following Knowledge Modules. Refer to the screenshots provided below.

• LKM SQL to Oracle

• CKM Oracle

• IKM Oracle Incremental Update

Note: When the Import Report window is displayed, close it.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 202: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 14

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 203: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 15

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 204: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 16

b. Click the Topology tab and select Contexts. Double-click the Global context. Select the Default check box to make this context default. Save Global and close the editor.

c. Navigate to the file C:\Labs\Files\Text\Create_Interface_sample.txt and

open this file with WordPad. View the script and note the following variables:

// Define variables:

def project = new String("<target project code>") // The target project code

def folder = new String("<folder in the target project>") // Folder in target project

// Define file with interfaces info:

def file = new File('<path to the file with interfaces info>') // The text file containing information about one or more interfaces to be created

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 205: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 17

d. You create the new interface in the project and use the model and topology you have created in steps 1 and 2. Open the Groovy editor. Copy the script from the text file and paste it into the Groovy editor.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 206: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 18

e. Edit the script by entering the following values from the table below:

Variable Value

project EDW

folder INITIALIZATION

File C:/Labs/Files/Text/Interfaces.txt

Note: If you do not have time, you can use the following preconfigured file: C:\Labs\Files\Text\Create_Interface.txt

f. Open the file that contains information about the interface (or interfaces) you are going to create: C:\Labs\Files\Text\Interfaces. In the file, you should have the following parameters, separated by comma. <Interface Name>,<Source Model>,<Source Datastore>,<Target Model>,<Target Datastore>

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 207: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 19

Refer to the table below to verify the parameters in the file:

Parameter Value

Interface Name

INT_BLK_SALES

Source Model

ORACLE_WH

Source Datastore

SRC_BULK_SALES

Target Model

ORACLE_SALES_APPLICATION

Target Datastore

TRG_BULK_SALES

Note: You can create multiple interfaces with one Groovy script by entering more lines in

this file. g. Run Groovy script and verify that your interface INT_BLK_SALES is successfully

created in the project DATA WAREHOUSING.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 208: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 20

h. Open the interface with editor. Click Mapping to view the mapping. Click the Flow tab to verify the flow.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 209: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 21

i. Execute the interface INT_BLK_SALES. In the Context field select Global. Open the

Operator tab and verify the execution results as shown below:

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 210: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Accelerating Development in ODI with Groovy

Chapter 7 - Page 22

j. Save your Groovy script in the c:\Labs\Groovy folder. Name this script Create_Interface. Click Save. Close the Groovy editor.

k. Close ODI Studio. If open, close SQL Developer.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 211: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 1

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 212: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 2

Practices for Lesson 8: Overview

Practices Overview In this practice, you explore the Complex File technology in ODI. The Complex File adapter allows ODI to read flat files with various formats like complex Cobol copybooks, multirecord format files, and so on. Usually, those files often require some preprocessing. This can be avoided in ODI with this Complex files technology. Complex files are accessed through the Oracle Data Integrator Driver for Complex File. This JDBC driver is installed with Oracle Data Integrator and requires no other installed component or configuration.

To enable the Complex files technology, you have to have the following connection information:

• The location of the native schema (nXSD) file associated with your native file

• The location of the native complex file

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 213: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 3

Practice 8-1: Configuring ODI Topology and ODI Model with Complex Files

Overview

In this practice, you perform the following steps:

1. View the input complex file and the native schema (nXSD).

2. Define the topology to enable connection to this complex file.

3. Create and reverse-engineer a new model for the complex file.

Your Tasks

1. Reset your practice environment. a. Verify that ODI Studio and SQL Developer are closed. If they are running, close them.

b. If necessary, start the command utility and change the directory to the C:\Labs\ResetPractice\reset_8 folder. Execute the resetRepo.bat command. Press any key when prompted. Verify that this command is executed successfully.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 214: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 4

2. View the complex input file and the native schema (nXSD) file, which you will use with Complex Files technology.

a. If not open, log in to ODI Studio as user SUPERVISOR with password SUNOPSIS.

b. Navigate to the C:\Labs\Files\Complex Files folder and open the Purchase_sample.txt and Purchase_schema.xsd files with WordPad. Note the root element in Purchase_schema.xsd file: “invoice”.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 215: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 5

c. The Purchase_sample.txt file is an invoice and stores line items as well as information about the seller (Oracle) and purchaser (Company One). You can see that this file contains different types of record formats as well as different delimiters.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 216: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 6

3. Define the topology to enable connection to this complex file.

a. Like every source and target in ODI, you first need to define a Data Server. In ODI Studio, open the Topology tab. In Physical Architecture, expand the Complex File technology node. Right-click Complex File and then select New Data Server. Name this new data server as PURCHASE_SAMPLE_CPLX_FILE.

b. Click the JDBC tab. The Complex File technology uses a JDBC driver to read the original input file as well as the metadata definition of this complex file (generated by using the Native Format Builder, a SOA component). To select driver, click the magnifying glass and then select JDBC driver: oracle.odi.jdbc.driver.file.complex.ComplexFileDriver.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 217: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 7

c. Here, you can see the path, which is automatically inserted in the JDBC URL. However, you still need to edit it to point to your input file as well as the path to its nXSD definition.

Note: Handling Complex File in ODI is similar to using the XML technology.

d. You input the path for the Purchase_sample.txt file and metadata definition file

Purchase_schema.xsd, which are located in the C:\Labs\Files\Complex_Files folder. Edit the URL to point to the input file and to the xsd file as shown below. Note: Highlighted are the sections, which you enter in the URL. You enter invoice as the root element of the Purchase_schema.xsd file.

jdbc:snps:complexfile?f=C:\Labs\Files\Complex_Files\Purchase_sample.txt&d=C:\Labs\Files\Complex_Files\Purchase_schema.xsd&re=invoice

Note: You can also find this preconfigured URL in the P8-1.txt text file located in C:\Labs\Files\Text.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 218: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 8

e. Test connection:

f. Create a new Physical schema for this Dataserver as shown in the following screenshot. For Schema and Work Schema, you select PURCH. Save the physical schema. Click OK.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 219: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 9

g. Open the Logical Architecture tab. Expand Technologies > Complex File and create new Logic Schema named Purchase_Sample_CPLX_FILE as shown in the following screenshot. Connect this Logical schema to the Physical schema PURCHASE_SAMPLE_CPLX_FILE. PURCH in all contexts. Save this logical schema.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 220: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 10

4. After you have defined the connectivity to your complex file, open the Designer tab and define the metadata for this file. Open the Models tab and create New Model. Name this model as Complex Files. Select Complex File technology. In the Logic Schema field, select the Purchase_Sample_CPLX_File logical schema. Save your model.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 221: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 11

5. Reverse-engineer your complex files model.

a. In the Models tab, view your new Complex File model.

b. Right-click this model and select Reverse-engineer.

c. Expand this complex file model and you can see that five datastores have been

created:

• INVOICE represents the file itself

• LINE_ITEM stores the information about each purchase

• SELLER contains the seller information

• PURCHASER contains the purchase information and ADDRESS stores the addresses of both the seller and the purchaser.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 222: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 12

d. Expand LINE_ITEM datastore to view the columns. Right-click LINE_ITEM and select

View Data. Close editor windows.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 223: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 13

e. Close ODI Studio. If open, close SQL Developer.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 224: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Working with Complex Files in ODI

Chapter 8 - Page 14

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 225: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 1

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 226: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 2

Practices for Lesson 9: Overview

Practices Overview In these practices, you configure the ODI Java EE Agent with an existing WLS domain and monitor your ODI environment using Enterprise Manager 11g, and ODI Console.

You learn how to:

• Expose an ODI scenario as a Public web service

• Modify and invoke the web service to execute the scenario with Java EE Agent

• Integrate ODI within a SOA and invoke the ODI scenario from the BPEL process

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 227: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 3

Practice 9-1: Integrating ODI in the Enterprise Environment

Overview In this practice, you perform the steps needed to configure the ODI Java EE Agent with an existing WLS domain and monitor your ODI environment using Enterprise Manager 11g and ODI Console.

Your Tasks

1. Reset your practice environment.

a. Verify that ODI Studio and SQL Developer are closed. If they are running, close ODI Studio and SQL Developer.

b. If necessary, start the command utility, Change directory to the following folder: C:\Labs\ResetPractice\reset_9. Execute the command: resetRepo.bat. Press any key when prompted. Verify that this command executed successfully.

2. Create and configure the ODI Java EE Agent to run on the existing WebLogic domain,

SOA_ODI_domain.

Note: This domain was precreated for this practice.

a. In Topology Navigator, open Physical Architecture, and then create a new ODI Agent. Name this agent OracleDIAgent. Set the port to 8002 and Host to localhost. Verify that the web application context is set to oraclediagent, as shown in the following screenshot. Save your new physical agent.

Note: The agent name is case-sensitive. Use the exact name OracleDIAgent, as shown in the following screenshot. Port 8002 is one that is used with WebLogic-managed server odi_server1.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 228: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 4

b. Open Logical Architecture and create a new logical agent with the same name as your

new physical agent, OracleDIAgent. Link this logical agent to the physical agent OracleDIAgent in all three contexts, as follows. Click Save to save your agent definition. Close the logical agent OracleDIAgent editing tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 229: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 5

3. Start the WebLogic Server domain.

a. Select the shortcut “Start WLS SOA_ODI_domain” from the desktop by double-clicking the icon:

b. Verify that SOA_ODI_domain started in RUNNING mode. Minimize (but do not close)

this Admin server command window. Note: It may take 1 or 2 minutes to start WebLogic Server.

c. Start WebLogic-managed servers: SOA_server1 and odi_server1.

d. In the command shell, change directory to the directory of the WLS Home: C:\Oracle\Middleware\user_projects\domains\SOA_ODI_domain\bin. Execute the command StartManagedWeblogic soa_server1. For Username, enter weblogic. For password, enter welcome1. It will take a minute or two for the server to start up and reach RUNNING mode. Verify that your managed server is started in RUNNING mode.

Note: It may take 1 or 2 minutes to start soa_server1.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 230: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 6

e. To start the odi_server1 managed server, change directory to WLS Home –

C:\Oracle\Middleware\user_projects\domains\SOA_ODI_domain\bin, and then execute command StartManagedWeblogic odi_server1. For Username, enter weblogic. For password, enter welcome1. The server will take a minute or two to start up and reach RUNNING mode. Verify that your managed server is started in RUNNING mode. Note: It may take 1 or 2 minutes to start odi_server1.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 231: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 7

Minimize (but do not close) this odi_server1 command window.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 232: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 8

f. Return to ODI Topology Navigator in ODI Studio. If necessary, open the Physical Architecture tab and the OracleDIAgent definition tab. Click Test to test the connectivity of your configured ODI Java EE Agent. When you see the success message in the ODI Information dialog box, click OK.

4. Use Enterprise Manager to monitor the WebLogic Server environment.

a. Start the browser and enter http://localhost:7001/em. Log in to Enterprise Manager. For User Name, enter weblogic. For Password, enter welcome1. On the Accessibility Preference screen that follows, click Continue.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 233: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 9

b. With Enterprise Manager, you can monitor and manage processes and resources. You can explore the deployed application by clicking each link. You can see running processes, workload, log file information, and more. Verify that both managed servers soa_server1 and odi_server1 are up and running.

c. Drill down into ODI objects by expanding ODI in the left panel. Expand the ODI node. Then expand MASTER REPOSITORY. Click Master Repository to view the details on your agents.

Note: Your information may differ from the information provided on these screens.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 234: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 10

d. Under MASTER REPOSITORY node, click localagent to view the details on your standalone agent.

e. Click the OracleDIAgent node in the left panel to see the Java EE Agent information.

f. Expand the Application Deployments node, and then click

oraclediagent(odi_server1). View the WebLogic Server application deployment information.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 235: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 11

5. Use ODI Console to explore your ODI environment.

Note: Your information may differ from the information provided on these screens.

a. In the browser, click Logout to exit Enterprise Manager. Enter http://localhost:8002/odiconsole to start the Oracle Data Integrator Console. To log in, enter SUPERVISOR as the User Id and enter SUNOPSIS as the Password.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 236: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 12

b. In the left panel, click the Design Time tab. Expand Projects, Models, and Topology as shown below:

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 237: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 13

c. Select the Loads project, and then click the View icon:

d. Scroll down and click the HandsOn folder link. Click the Interfaces tab. Explore the interfaces created in your Loads project.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 238: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 14

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 239: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 15

e. Exit the First Folder by clicking the View button again in the left panel. Click other tabs in the right panel. Explore the different ODI objects in your project.

f. Similarly, explore models in your Work Repository. To explore the datastores, scroll down and select the Global submodel name. Scroll down and view the datastores.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 240: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 16

When you have finished exploring, log out of ODI Console and close the browser. O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 241: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 17

Practice 9-2: Exposing an ODI Scenario as a Web Service

Overview In this practice, you create a new ODI scenario, modify a web service, and invoke the Web service to execute the scenario.

1. Create and execute a new scenario, INT_TRG_SALES_PERSON.

2. Create a new package, OdiInvokeWebService.

3. Use the OdiInvokeWebService tool from the toolbox to create the corresponding step in the package.

4. Define parameters of the web service by using the Advanced dialog box and the SOAP Editor.

5. Invoke your web service from the SOAP Editor to execute the scenario INT_TRG_SALES_PERSON.

6. View the response and verify the execution results.

Your Tasks

1. Generate a new scenario for the interface. Note: You should have both WebLogic-managed servers soa_server1 and odi_server1

up and running.

a. If necessary, connect to your ODI Studio, In Designer, open the Projects tab, expand the Export Files project > First folder > Interfaces. Right-click INT-TRG_SALES_PERSON and select Generate Scenario. Enter name INT_TRG_SALES_PERSON in the Name field, and then click OK. Open the “Load Plans and Scenarios” tab and verify that the scenario was generated.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 242: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 18

Important Note: Your version of the generated scenario can be different from the one shown in the screenshot. Memorize your version. It will be used in future steps.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 243: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 19

b. Right-click the INT_TRG_SALES_PERSON scenario and execute your newly created scenario, as follows. For Agent, select your Java EE Agent: OraceDIAgent. Click OK to confirm the execution.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 244: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 20

c. View the results of the execution in Operator Navigator. Click Refresh. Expand Agent > OracleDIAgent node. The INT_TRG_SALES_PERSON session should appear as complete.

.

2. Create a new package by using the OdiInvokeWebService tool.

a. On the Projects tab, expand the Export Files project > First Folder. Right-click Packages and select New Package. Enter TRG_SALES_PERSON_PKG in the Name field, and then click the Diagram tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 245: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 21

b. In the Toolbox panel, click the Internet tab, scroll down to the OdiInvokeWebService tool. Click the OdiInvokeWebService tool and then click the empty panel on the right. An OdiInvokeWebService tool step appears in the package.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 246: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 22

c. Click the Free choice tool on top of the client and then select the step just added (OdiInvokeWebService 1). View the properties panel at the bottom of the studio client. If the properties panel does not appear, expand the size of the client window (downwardly) to reveal it.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 247: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 23

d. Click the “Advanced” button on the “General Tab” under “Properties.”

e. In the Properties panel, retain the default name OdiInvokeWebService 1 for the “Step

name” field. Scroll down and define parameters in the Properties panel as follows:

Parameter Value

WSDL URL - Leave blank -

Port Type - Leave blank -

Operation - Leave blank -

XML Request - Leave blank -

Request File - Leave blank -

Storage Mode for Response File FILE APPEND

File Encoding for Response File ISO8859_1

XML Encoding for Response File ISO-8859-1

Response File C:/TEMP/WebServiceToolStep

Response File Format SOAP

HTTP User - Leave blank -

HTTP Password - Leave blank -

Execution Timeout (ms) - Leave blank -

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 248: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 24

. f. Click the Advanced button. A new window opens. Enter

http://localhost:8002/oraclediagent/OdiInvoke?wsdl in the Web

Service Description File (WSDL) URL field. Click the Connect to WSDL button .

The appropriate port OdiInvokePortType is automatically detected and the available operations are displayed on the left.

Note: You can find this URL in the following text file: C:\Labs\Files\Text\ P9-1.txt.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 249: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 25

g. Select the invokeStartScen operation from the panel on the left. Click the Editor tab at

the bottom of the middle panel. Widen the middle panel, if necessary, to see the Name and Value columns. Enter the parameters in the request parameter fields as provided in the following table. Your SOAP Editor panel should appear as follows

Note: Press Enter each time to confirm your entries.

Parameter Value

<OdiUser> SUPERVISOR

<OdiPassword> SUNOPSIS

<WorkRepository> WORKREP

<ScenarioName> INT_TRG_SALES_PERSON

<ScenarioVersion> <Insert your version>

<Context> DEVELOPMENT

<Synchronous> true

LogLevel 5

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 250: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 26

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 251: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 27

h. Click the Source tab to view the scenario request. Click the Remove Blank Optional

Elements icon to remove all blank optional elements from the query. This is necessary to construct a valid query. The request should be as follows.

Note: You can also select the Clean up before execution check box . This option automatically deletes the empty optional elements in the SOAP request.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 252: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 28

3. Invoke your Web service.

a. To invoke your Web service, click the Invoke Web Service icon. The response is displayed in the right panel of the editor. Verify that your Web service processed successfully, as shown in the following screenshot:

b. Click OK to close the Advanced Editor window. Click the Save button to save your

package and close the tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 253: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 29

c. In ODI Operator, verify that the INT_TRG_SALES_PERSON scenario successfully

executed.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 254: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 30

Practice 9-3: Integrating ODI with a BPEL process Within SOA

Overview This practice teaches you how to integrate ODI with a BPEL process within SOA.

1. Create and test a new scenario to execute a package previously created in Practice 5-1.

2. Configure and deploy the BPEL process to invoke ODI web service, which will execute the scenario.

3. Execute, test, and monitor execution of the web service and ODI scenario.

Your Tasks

1. Your WebLogic Admin server and WebLogic-managed server soa_server1 should be running at this point. Open the Enterprise Manager (EM) and verify that your SOA_ODI_domain servers are up and running. If not running, start the WebLogic Server domain as described in Practice 9-1, Steps 2, 3.

Note: If not started, start EM as described in Practice 9-1, Step 4.

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 255: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 31

2. Generate a new scenario for the package PKG_LOAD_PRODUCT, which you created in Practice, 6-1.

a. If necessary connect to your ODI Studio. In Designer, open the Projects tab, expand the Loads project > HandsOn folder > Packages. Right-click PKG_LOAD_PRODUCT and select Generate Scenario. Enter name PKG_LOAD_PRODUCT in the Name field, and then click OK

Important Note: You version of the generated scenario can be different from the one shown in the screenshot. Memorize your version. It will be used in future steps.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 256: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 32

b. In the Scenario Variables window, accept Use Selected and click OK. Open the “Load Plans and Scenarios” tab and verify that the scenario was generated.

c. Right-click the PKG_LOAD_PRODUCT scenario and execute your newly created

scenario, as follows. For Agent, select your Java EE Agent: OraceDIAgent. View the current value of variable, and then click OK to confirm the execution.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 257: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 33

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 258: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 34

d. View the results of the execution in Operator Navigator. Click Refresh. Expand Agent > OracleDIAgent node. The session PKG_LOAD_PRODUCT should appear as complete.

.

3. Create the BPEL process that will call your ODI scenario. a. Open JDeveloper by double-clicking the “Shortcut to jdeveloper…” on the desktop.

Ensure that you have only double-clicked once to prevent additional copies from loading (the interface may take a minute to load).

Note: When you start JDeveloper for the first time, it may take longer to open the GUI.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 259: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 35

b. You should see the partially preconfigured BPEL process ODIInvokeBPEL.bpel. This BPEL process is located in the ODI_SOA_HOL application under ODI_Invoke > SOA node. Note the steps in the BPEL process. The odiinvokebple_client partner link should be present in your diagram.

Note: If not open, click View > Application Navigator to view Applications, Projects, and other resources.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 260: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 36

c. In this step, you will be adding the ODI scenario created in Step 3 to the BPEL

process. In the “Partner Links” lane, right-click and select Create Partner Link.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 261: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 37

d. When prompted with the Create Partner Link dialog box, rename Partner Link as “ODIAgentWS” and enter the following WSDL URL:

http://localhost:8002/oraclediagent/OdiInvoke?wsdl

Note: You can find this URL in the following text file: C:\Labs\Files\Text\P9-3.txt.

Click the down arrow to “Partner Link Type” and select “Yes to the Partner Link Type dialog box.

Change the Partner Link Type to requestPortType_PL. Change Partner Link Role to requestPortType_Role.

The “Create Partner Link” dialog box should look like this. Click OK.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 262: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 38

e. From the Component Palette on the right, choose BPEL Constructs > Web Service > Invoke and drag the construct to the design area after the PrepareODIParam step.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 263: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 39

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 264: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 40

f. Drag the right arrow of the Invoke step to the ODIAgentWS partner link.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 265: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 41

g. In the Edit Invoke dialog box, enter a new Name CallInvoke. Select invokeStartScen as the Operation. Next to the Input variable, click the lookup icon. In the Variable Chooser dialog box, select CallInvoke_invokeStartScen_InputVariable.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 266: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 42

h. Next to the Output variable, click the lookup icon. In the Variable Chooser dialog box, select CallInvoke_invokeStartScen_OutputVariable.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 267: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 43

The “Edit Invoke” dialog box should look like the following:

Click OK.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 268: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 44

i. The input variable for the “CallInvoke” step has already been initialized in

“PrepareODIParam”.

However, you need to edit some of these parameters. Double-click the PrepareODIParam step to edit it. To edit the values for input parameters, right-click the parameter and select Edit “From” expression as shown below.

Important Note: You have to use your version of the generated scenario.

Parameter Value

<OdiUser> SUPERVISOR

<OdiPassword> SUNOPSIS

<WorkRepository> WORKREP

<ScenarioName> PKG_LOAD_PRODUCT

<ScenarioVersion> <Your Scenario Version>

<Context> DEVELOPMENT

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 269: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 45

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 270: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 46

j. You Assign step should look as follows:

Click OK.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 271: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 47

k. Drag another Invoke after “PrepareODIGetStatus”:

l. Drag the right arrow of the Invoke onto the previously defined “ODIAgentWS” partner

link.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 272: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 48

m. In the Edit Invoke dialog box:

• Enter a new Name ODIGetStatus.

• Choose the operation getSessionStatus.

• Next to the Input variable, click the lookup icon. In the Variable Chooser dialog box, select ODIGetStatus__ getSessionStatus_InputVariable.

• Next to the Output variable, click the lookup icon. In the Variable Chooser dialog box, select ODIGetStatus_ getSessionStatus _OutputVariable.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 273: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 49

The Edit Invoke dialog box should look like this. Click OK.

n. The input variable for the “CallInvoke” step has already been initialized in the“PrepareODIGetStatus” step. Double-click this step to review and verify data entered for the variables. You don’t need to edit this step. Click OK.

Note: The session ID in the output of the “StartScenario” call is used for input here.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 274: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 50

o. The BPEL Process “ODIInvokeBPEL.bpel” should look as follows:

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 275: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 51

Click the Save All button to save your project.

4. Deploy your BPEL process project to the application server and test your web service. a. Right-click the ODIInvoke project, and then select Deploy > ODIInvoke. In the “Deploy

ODIInvoke” dialog box, select “Deploy to Application Server.” Click Next.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 276: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 52

b. In the “Deploy Configuration” section, select the “Overwrite any existing composites with the same revision ID” check box. Click Next.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 277: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 53

c. In the “Select Server” section, select the server “SOA,” and click Next.

Click Next, and then click Finish.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 278: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 54

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 279: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 55

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 280: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 56

5. Test your composite SOA application.

a. Open web browser with Enterprise Manager. If necessary, enter the following URL to log in to Enterprise Manager 11g: http:// localhost:7001/em

For User Name, enter weblogic. For Password enter welcome1.

b. Expand Farm_SOA_ODI_domain > SOA > soa-infra (soa_server1) > default. Click

ODIInvoke [1.0]. Click the Test button as shown below. In the next screen, click Test Web Service.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 281: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 57

c. Verify that ODI invocation was successful as shown below:

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 282: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 58

d. In ODI Studio, open the Operator. Expand Agent > OracleDIAgent node, and then verify that your ODI scenario was successfully executed by the Java EE Agent:

e. Close ODI Studio. If open, close SQL Developer.

6. Stop the managed WebLogic Server and WebLogic Admin Server.

a. Run the command utility and change the directory to: C:\Oracle\Middleware\user_projects\domains\SOA_ODI_Domain\bin

To stop the managed WebLogic Server, execute the command: stopManagedWeblogic soa_server1

For username, enter: weblogic. For password, enter welcome1. Verify that the managed server is stopped.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 283: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 59

b. To stop WebLogic Server, from the same directory execute the command:

stopWebLogic

For username, enter weblogic. For password, enter welcome1.

Verify that WebLogic Server is stopped.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 284: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Integration of ODI in Enterprise Environment and SOA

Chapter 9 - Page 60

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 285: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 1

Practices for Lesson 10: Enhancing ODI Security

Chapter 10

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 286: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 2

Practices for Lesson 10: Overview

Practices Overview Oracle Data Integrator can use Oracle Platform Security Services (OPSS), a standards-based and portable security framework for Java applications, to authenticate its users against an external Identity Store, which contains enterprise users and passwords. Such an identity store is used at the enterprise level by all applications, in order to have centralized user and password definitions and Single Sign-On (SSO). In such a configuration, the ODI master repository only contains references to these enterprise users. This authentication method is called External Authentication.

Practice 10-1 provides a step-by-step walkthrough of the process of implementing ODI external authentication with OID LDAP Server.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 287: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 3

Practice 10-1: Implementing ODI External User Authentication

Overview In this practice, you perform the following steps:

1. Use SQL Developer to create an RDBMS (11g) Schema/User for a new ODI Master Repository.

2. Create a new OID user with Directory Services Manager.

3. Edit the ODI jps-config.xml file to point to your external OID LDAP server.

4. Run the script to set up the credentials for idstore.oid LDAP in the identity store.

4. Create a new ODI master repository referencing a user in the external OID LDAP server.

5. Switch the Master Repository authentication mode between external and internal authentications.

Your Tasks

1. Reset your practice environment. a. Verify that ODI Studio and SQL Developer are closed. If they are running, close them.

b. If necessary, start the command utility, change the directory to the C:\Labs\ResetPractice\reset_10 folder. Execute the resetRepo.bat command. Press any key when prompted. Verify that this command is executed successfully.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 288: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 4

2. You have to create the RDBMS schema or user (Oracle 11g) for the new Master repository. The schemas can be created by executing the following SQL commands:

a. If not open, start SQL Developer and connect to the ORCL connection with the password as oracle1.

b. The schemas can be created by executing the following SQL command: create user oiduser identified by oiduser default tablespace users temporary tablespace temp;

Note: In this command, the password to connect to the oiduser user is oiduser.

Note: You can find this and other commands in the P10-1.txt text file located in the C:\Labs\Files\Text folder.

c. Verify that the OIDUSER schema is created under the Other Users node.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 289: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 5

d. In SQL Developer, execute the command to grant necessary privileges to OIDUSER: Grant connect, resource to oiduser;

When done, close SQL Developer.

3. Start the WebLogic server and external LDAP server (OID).

Run the command utility and change the directory to C:\Oracle\Middleware\user_projects\domains\IDMDomain\bin.

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 290: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 6

a. To start the Admin WebLogic server, execute the command: startWebLogic.cmd

For User and Password, enter weblogic and welcome1, respectively. When the WebLogic server starts in the RUNNING mode, minimize (but do not close) the command window. Note: It may take 1 or 2 minutes to start the WebLogic server.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 291: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 7

b. To start managed WebLogic server, open the new command window and change to the same directory: C:\Oracle\Middleware\user_projects\domains\IDMDomain\bin

Execute the startManagedWeblogic wls_ods1 command.

For User and Password, enter weblogic and welcome1, respectively.

Verify that the managed server is started in the RUNNING mode. Minimize (but do not close) the command window. Note: It may take 1 or 2 minutes to start managed WebLogic server.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 292: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 8

4. Create a new LDAP user with Directory Services Manager.

a. To connect to DSM, start the browser and enter the URL: http://edvmr1p0:7005/odsm/

b. Click Connect to Directory and then select the OID-oid1 connection. For password,

enter welcome1. Click Connect.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 293: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 9

c. Click the Data Browser tab. In the Data Tree, expand Root > dc=Myrealm>cn=Users. Right-click cn=orcladmin and then select Create Like.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 294: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 10

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 295: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 11

d. Select the person tab and click Next. In Mandatory Properties, enter the new administrative username as supervisor1 in first two fields (cn and sn) as shown in the following screenshot. In the Relative Distinguished Name field, select cn. Click Next.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 296: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 12

e. For the Optional Properties, enter the values provided in the following table. Click Next. Click Finish. Note: You may need to scroll down to view all properties.

Field: Value:

givenName supervisor1

mail [email protected]

orclActiveStartDate Leave default value

orclSAMAccountName supervisor1

uid supervisor1

userPassword SUNOPSIS1

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 297: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 13

f. Verify that the new LDAP user supervisor1 was created and shown in the Data tree:

5. The configuration to connect to and use the identity store is contained in an OPSS Configuration file called the jps-config.xml file. This file is already preconfigured to point to your external OID LDAP Server.

a. Copy the jps-config.xml file from the C:\Labs\Files\LDAP folder and paste it into the following folder: C:\Oracle\Middleware\Oracle_ODI1\oracledi\client\odi\bin

b. In the same folder. Open the jps-config.xml file with WordPad and verify that you have the following four sections in the file and view their properties. Close the jps-config.xml file.

Note: This file is preconfigured for the purpose of this practice. Do not edit this file.

1) <!-- ldap provider -->

2) <!-- JPS OID LDAP Identity Store Service Instance -->

3) <!-- Basic Authenticator Login Module -->

4) <!-- The default JPS context … -->

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 298: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 14

To ensure proper configuration, verify that the parameters in OID LDAP Identity Store Service Instance section are based on the values provided in the following table. Note: You do not need to edit these parameters.

Property Value

"subscriber.name" "dc=myrealm"

"idstore.type" "OID"

"cleartext.ldap.credentials"

"cn=orcladmin:welcome1"

"ldap.url" "ldap://edvmr1p0.us.oracle.com:3060"

<extendedProperty>

user.search.bases

cn=users,dc=myrealm

</extendedProperty>

group.search.bases

cn=groups,dc=myrealm

</extendedProperty>

"username.attr"

"uid"

</extendedProperty>

"groupname.attr"

"cn"

Note: Your machine name in ldapurl property is edvmr1p0. The port number of your LDAP server in this configuration is 3060.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 299: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 15

Also, verify that you have the following three sections in your file. Note: You do not need to edit them.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 300: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 16

6. Create the new ODI master repository referencing a user in the external OID LDAP server. a. If not started, start ODI Studio, and then open 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.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 301: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 17

b. 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.

Note: Do not copy and paste this URL—that may cause some errors! Enter the User as oiduser and the Password as oiduser. For the DBA user, enter system, for DBA Password, enter oracle1. Click the Test Connection button and verify successful connection. Click OK. Click Next on the Master Repository Creation Wizard screen.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 302: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 18

c. In the Authentication window, select Use External Authentication. (If you had selected Use ODI Authentication, you would have been using ODI's internal authentication.) For Supervisor User, enter supervisor1 and for Supervisor Password, enter SUNOPSIS1, as they exist in your external datastore. Click Next.

Note: Usernames and passwords are case-sensitive in ODI.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 303: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 19

d. In the Password Storage window, select Internal Password Storage, and then click Finish. It takes 2 or 3 minutes to create the Master repository. When the Master Repository is successfully created, you will see the Oracle Data Integrator Information message. Click OK. The ODI Master repository is now created.

Note: It may take a few minutes to create ODI Master Repository.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 304: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 20

7. Create the new ODI Master Repository Login.

a. 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.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 305: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 21

b. Configure Repository Connections with the parameters from the following table. In the Oracle Data Integrator Connection section, enter the User and Password of the authenticated user in your external store. In this example, you specify SUPERVISOR1 as the User and SUNOPSIS1 as the Password from the OID LDAP Server. In the Database Connection (Master Repository) section, enter the User and Password of the schema user you created for the master repository. In this example, you specify oiduser as the User and oiduser as the Password. To enter the JDBC URL, click the button next to the JDBC URL field and select jdbc:oracle:thin:@<host>:<port>:<sid> as shown in the screenshot, and then edit the URL. Select the Master Repository Only button. Click the Test button. Verify successful connection and click OK. Click OK to save the connection.

ODI Connection section field Value

Login Name LDAP LOGIN

User supervisor1

Password SUNOPSIS1

Database Connection (Master Repository) section field

Value

User oiduser

Password oiduser

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 URL from the list. Edit the URL in the URL field.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 306: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 22

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 307: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 23

Click Connect to Repository. Log in to connection LDAP Test Login created above by using the supervisor1/SUNOPSIS1 credentials.

Note: For the purpose of this practice, you are not connected to your development work repository used for other exercises.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 308: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 24

c. If not open, open ODI Security Navigator. Expand the Users accordion. Double-

click User supervisor1 to open it. You can now see that the SUPERVISOR user has External GUID, which comes from the OID LDAP server. Close the supervisor1 tab.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 309: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 25

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 310: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 26

8. Switch the Master repository authentication mode between external and internal authentications.

a. Disconnect Oracle Data Integrator Studio from the repository. From the ODI main menu, select Switch Authentication Mode.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 311: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 27

b. Select LDAP LOGIN. Specify the JDBC connectivity details of your Oracle Data Integrator master repository as defined when you connect to the Master Repository. For User and Password, enter oiduser and oiduser, respectively.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 312: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 28

c. In this screen, you are prompted to switch to internal authentication. You must provide and confirm a password for the new SUPERVISOR user that the wizard will automatically create in the repository. For Password, enter twice: SUPERVISOR. Click Finish. The Authentication mode is changed.

9. Re-activate users after switching to Internal Authentication.

a. Reconnect to the Oracle Data Integrator master repository. Select LDAP LOGIN. Enter the new user name SUPERVISOR, with the password you have provided in the wizard: SUPERVISOR.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 313: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 29

b. Note that in the Security tab, the user supervisor1 is shown as deactivated. Right-click user supervisor1 to edit it.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 314: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 30

c. Deselect Expiration Date. Click the Change Password button and enter the new password for this user: SUNOPSIS1. Click the Save icon.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 315: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 31

d. Click the Refresh icon. Verify that your user supervisor1 is now shown as active. Close the supervisor1 tab. Disconnect LDAP LOGIN.

10. Now, you may want to experiment with switching back to external authentication mode. Remember that ODI users with the same name as users in external LDAP server (for example, user supervisor1) will be mapped automatically. Users that cannot be mapped will be inactivated in ODI. In this step, you will switch your actual ODI work repository environment to external authentication mode.

a. To connect to your practice environment, select the Login Name as DEV_ODI_REPO. For User, you enter SUPERVISOR and for Password, enter SUNOPSIS.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 316: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 32

b. Select the Security tab, and then select New User, as shown below.

c. The new user name should match the user name in LDAP server. You enter supervisor1. For password, enter supervisor1. Select the Supervisor Access Privileges check box. Click the Save button.

Note: The password supervisor1 is still the internal user password and it will be dropped during switch.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 317: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 33

d. Disconnect from your work repository by selecting ODI > Disconnect “DEV_ODI_REPO”. From ODI menu, select Switch Authentication Mode.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 318: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 34

In the Switch Authentication Mode window, select the Login: DEV_ODI_REPO. For User and Password, enter dev_odi_repo and oracle1, respectively. Click Next and then click Finish. In the Information window, click OK.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 319: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 35

To verify that you have successfully switched your work repository environment to External Authentication mode, log in DEV_ODI_REPO with your LDAP user credentials. For User and Password, enter supervisor1 and SUNOPSIS1, respectively.

Verify that you have an access to your work environment. In the Security tab, select Users accordion. Note that user supervisor1 is now active, but user SUPERVISOR has been deactivated during the switch to the External Authentication mode.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 320: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 36

11. Stop managed WebLogic server and Admin server.

a. Run the command utility and change the directory to: C:\Oracle\Middleware\user_projects\domains\IDMDomain\bin

b. To stop managed WebLogic server, execute the command: stopManagedWeblogic wls_ods1

For User and Password, enter weblogic and welcome1, respectively.

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 321: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 37

c. To stop the WebLogic server, from the same directory, execute the stopWebLogic command.

For User and Password, enter weblogic and welcome1, respectively.

Verify that WebLogic server is stopped.

O

racl

e U

nive

rsity

and

(Ora

cle

Cor

pora

tion)

use

onl

y.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.

Page 322: D78191GC10_ag

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Enhancing ODI Security

Chapter 10 - Page 38

Ora

cle

Uni

vers

ity a

nd (O

racl

e C

orpo

ratio

n) u

se o

nly.

Thes

e eK

it m

ater

ials

are

to b

e us

ed O

NLY

by

you

for t

he e

xpre

ss p

urpo

se S

ELF

STU

DY.

SH

ARIN

G T

HE

FILE

IS S

TRIC

TLY

PRO

HIB

ITED

.