d64974gc10_ag - copy.pdf

450
Oracle Data Integrator 11g : Integration and Administration Activity Guide D64974GC10 Edition 1.0 December 2010 D68949

Upload: mamatamaharana

Post on 07-Aug-2018

266 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 1/449

Oracle Data Integrator 11g :Integration andAdministration

Activity Guide

D64974GC10

Edition 1.0

December 2010

D68949

Page 2: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 2/449

Copyright © 2010, 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, pleasereport them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is notwarranted 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 RIGHTSThe U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restrictedby the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.

Trademark Notice

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective

owners.

Authors

Viktor Tchemodanov, Richard Green

Technical Contributors and Reviewers

Nagavalli Pataballa, Nancy Greenberg, Denis Gray, Jeff Pollock, FX Nicolas,

Christophe Dupupet, Art Hetherington, Usha Ramanathan, Gerry Jurrens,

Phillip Scott, Taj-ul Islam

This book was published using: Oracle Tutor  

Page 3: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 3/449

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

Oracle Data Integrator 11g: Integration and Administration Table of Contents

i

Table of Contents

Practices for Lesson 2 .............................................................................................................................. 1-1 

Practices for Lesson 2: Flow of Data ............. ............. ............. .............. ............. ............. .............. ........... 1-2 

Practice 2-1: Creating and Connecting to ODI Master and Work Repositories ............ ............ ............. ...... 1-3 

Practices for Lesson 3 .............................................................................................................................. 2-1 

Practice 3-1: Setting Up and Installing an ODI Agent ............ ............. ............. ............. ............. ............. ... 2-2 

Practices for Lesson 4 .............................................................................................................................. 3-1 

Practice 4-1: Working with Topology ........................................................................................................ 3-2 

Practices for Lesson 5 .............................................................................................................................. 4-1 

Practice 5-1: Creating a Model ................................................................................................................ 4-2 

Practices for Lesson 6 .............................................................................................................................. 5-1 

Practice 6-1: Setting Up a New ODI Project ............................................................................................. 5-2 

Practices for Lesson 7 .............................................................................................................................. 6-1 

Practice 7-1: Checking Data Quality in the Model ............. ............. ............. ............ ............. ............. ........ 6-2 

Practices for Lesson 8 .............................................................................................................................. 7-1 

Practice 8-1: Creating ODI Interface: Simple Transformations ................. ............. ............. ............. .......... 7-2 

Practices for Lesson 9 .............................................................................................................................. 8-1 

Practice 9-1: Creating ODI Interface: Complex Transformations ............ ............. ............. ............. ............ 8-2 

Practice 9-2: Creating ODI Interface: Implementing Lookup ............ ............. ............. ............. ............. ...... 8-20 

Practices for Lesson 10 ............................................................................................................................ 9-1 

Practice 10-1: Creating ODI Interface: Exporting a Flat File to a Relational Table ............ ............ ............. . 9-2 

Practices for Lesson 11 ............................................................................................................................ 10-1 

Practice 11-1: Using Native Sequences with ODI Interface ............. ............. ............. ............. ............. ...... 10-2 

Practice 11-2: Using Temporary Indexes ................................................................................................. 10-15 

Practice 11-3: Using Data Sets with ODI Interface ............. ............. ............. .............. ............. ............. ..... 10-24 

Practices for Lesson 12 ............................................................................................................................ 11-1 

Practice 12-1: Using Temporary ODI Interfaces .................. ............. ............. ............. ............ ............... ... 11-2 Practice 12-2: Developing a New Knowledge Module ............ ............. ............. ............. ............. ............. .. 11-33 

Practices for Lesson 13 ............................................................................................................................ 12-1 

Practice 13-1: Creating an ODI Procedure ............. ............. ............. ............. ............. ............. .............. ... 12-2 

Practices for Lesson 14 ............................................................................................................................ 13-1 

Practice 14-1: Creating an ODI Package ............ ............ ............. ............. ............. ............. ............. ......... 13-2 

Practice 14-2: Using ODI Package with Variables and User Functions ............ ............. ............. ............. ... 13-13 

Practices for Lesson 15 ............................................................................................................................ 14-1 

Practice 15-1: Working with ODI Versions ............ ............. ............. ............. ............. .............. ............. ..... 14-2 

Practices for Lesson 16 ............................................................................................................................ 15-1 

Practice 16-1: Creating and Scheduling an ODI Scenario ............ ............. ............. ............ ............. .......... 15-2 

Practices for Lesson 17 ............................................................................................................................ 16-1 

Practice 17-1: Enforcing Data Quality with ODI Interface ........... .............. ............. ............. ............. .......... 16-2 

Practices for Lesson 18 ............................................................................................................................ 17-1 

Practice 18-1: Implementing Changed Data Capture ............. ............. ............. ............. ............. ............. .. 17-2 

Practices for Lesson 19 ............................................................................................................................ 18-1 

Practice 19-1: Setting Up ODI Security .................................................................................................... 18-2 

Practice 19-2: Integration with Enterprise Manager and Using ODI Console ............ ............. ............. ........ 18-21 

Page 4: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 4/449

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

Oracle Data Integrator 11g: Integration and Administration Table of Contents

ii

Practices for Lesson 20 ............................................................................................................................ 19-1 

Practice 20-1: Executing an ODI Scenario Through the ODI Public Web Service....................... ............. ... 19-2 

Page 5: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 5/449

 

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

Practices for Lesson 2

Chapter 1 - Page 1

Practices for Lesson 2

Chapter 1

Page 6: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 6/449

 

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

Practices for Lesson 2

Chapter 1 - Page 2

Practices for Lesson 2: Flow of Data

Page 7: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 7/449

 

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

Practices for Lesson 2

Chapter 1 - Page 3

Practice 2-1: Creating and Connecting to ODI Master and WorkRepositories

Use Case Scenario: 

John works as a database administrator for FN Enterprise. In FN Enterprise, John is responsiblefor performing database management and integration tasks on various resources within theorganization. In particular, John is responsible for data loading, transformation, and validation.To set his ODI environment, he needs to set up the security with his OD and create Master andWork repositories.

Background:

The first steps to setting up Oracle Data Integrator are to create database users for the Masterand Work repositories, then create the Master repository, connect to the Master repository,create the Work repository, and then connect to the Work repository.

In this practice, you first use SQL Developer to create the database users for the Master andWork repositories. Then, in ODI you create and connect to the ODI Master Repository and theODI Work Repository.

Note: These are practice repositories. In later lessons, you use other Master and Workrepositories that are partially predefined with source and target objects.

 Your Tasks:

SQL Develo er

• Create SNPM1 database user formaster  repository

• Create SNPW1 database user forwork  repository

database-play.png

 Oracle DataIntegrator 

• Create master repository

• Create Master Repository connection“Master Repository Pr 2-1” with SNPM1as the user

• Create work  repository

• Create WORKREP_PR2-1 workrepository connection with SNPW1 asthe user

datab024.gif 

Page 8: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 8/449

 

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

Practices for Lesson 2

Chapter 1 - Page 4

1. The RDBMS used in this practice is Oracle 11g . To connect to your RDBMS, perform thefollowing steps:

Step Screen/Page Description Choices or Values

a. MS Windows Start the SQL Developer by selecting Start >Programs > Oracle-OraDb11g_home1 >Application Development > SQL

Developer . When SQL Developer starts,close the Logging Page – Log tab.

b. Oracle SQL Developer In Oracle SQL Developer, click “+” to expandthe connection Administrator. In the windowthat follows, enter system in the User name field, oracle1 in Password, and then clickOK.

a.

b.

2. Create the RDBMS schema or user (Oracle 11g ) for the Master repository.

Page 9: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 9/449

 

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

Practices for Lesson 2

Chapter 1 - Page 5

Step Screen/Page Description Choices or Values

a. Oracle SQL Developer Click OK to “The RDBMS user/schema canbe created by executing the following SQLcommand:”

create user snpm1 identified bypassword

default tablespace userstemporary tablespace temp;

Note: You can find this command in the textfile 2-1.txt located in c:\LABS\Text folder.

Enter this command and then click the Run button.

Note: In this command, “password” is thevalue of password to connect to user snpm1.

b. Oracle SQL Developer Grant connect privileges to the newly createduser by executing the following SQLcommand:

grant connect, resource to snpm1;

c. Oracle SQL Developer Expand the Other Users node to verify thatuser snpm1 was successfully created.

a.

b.

Page 10: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 10/449

 

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

Practices for Lesson 2

Chapter 1 - Page 6

c.

3. Create the ODI Master repository:

Page 11: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 11/449

 

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

Practices for Lesson 2

Chapter 1 - Page 7

Step Screen/Page Description Choices or Values

a. MS Windows  Start Oracle Data Integrator: Start >Programs > Oracle ODI 11g-Home >Oracle Data Integrator  > ODI Studio. 

b. Oracle Data Integrator   Open the New Gallery by choosing File >

New.In the New Gallery , in the Categories tree,select ODI.

Select from the Items list the MasterRepository Creation Wizard. Click OK.

The Master Repository Creation Wizard appears. 

c. Master Repository Creation Wizard In the Master Repository Creation Wizard ,select the browse icon of the JDBC Driver  

and then select Oracle JDBC Driver . ClickOK. Edit the JDBC URL to read: 

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

Enter the User as snpm1 and the Passwordas password . Click the Test Connection button and verify successful connection. ClickOK. Click Next on the Master RepositoryCreation Wizard  screen.

d. Master Repository Creation Wizard In the Authentication window, enter theSupervisor Password as

SUNOPSIS. Enter

SUNOPSIS again to confirm the password.Click Next.

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

e. Password Storage In the Password Storage window, selectInternal Password Storage, and then clickFinish. When Master Repository issuccessfully created, you will see the Oracle

Data Integrator Information message. ClickOK. The ODI Master repository is nowcreated.

f. Message Verify that ODI Master Repository wascreated successfully, and then click OK.

a.

Page 12: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 12/449

 

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

Practices for Lesson 2

Chapter 1 - Page 8

b.

Page 13: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 13/449

 

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

Practices for Lesson 2

Chapter 1 - Page 9

c.

Page 14: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 14/449

 

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

Practices for Lesson 2

Chapter 1 - Page 10

d.

e.

Page 15: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 15/449

 

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

Practices for Lesson 2

Chapter 1 - Page 11

f.

4. Connect to the ODI Master repository by creating a new ODI Master Login:

Step Screen/PageDescription

Choices or Values

a. Oracle DataIntegrator

Open the New Gallery by choosing File > New. In the NewGallery , in the Categories tree, select ODI. From the Items

list, select Create a New ODI Repository login.

b. RepositoryConnections

Configure the repository connections with the parametersfrom the following tables. To enter the JDBC URL, click thebutton next to the JDBC URL f ield and selectjdbc:oracle:thin:@<host>:<port>:<sid>, as shownin the screen, then edit the URL. Select the MasterRepository only button. Click the Test button. Verify

Page 16: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 16/449

 

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

Practices for Lesson 2

Chapter 1 - Page 12

Step Screen/PageDescription

Choices or Values

successful connection and click OK. Click OK to save theconnection.

Oracle Data Integrator Connection

Parameter Value

Login Name Master Repository Pr 2-1

User SUPERVISOR

Password SUNOPSIS 

Database Connection (Master Repository)

Parameter Value

User snpm1 

Password password 

Driver List Oracle JDBC Driver

DriverName

oracle.jdbc.OracleDriver

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

Note: Do not copy and paste in the JDBC URL field. Thismay cause problems with entering a valid URL string.Instead, open the drop-down menu and select the correctdriver from the list. Type the correct URL in the Url field.

Note: The ODI user name (SUPERVISOR) is case-sensitive.

c. Oracle DataIntegrator

Click Connect to Repository. Select the newly createdrepository connection, Master Repository Pr 2-1, from thedrop-down list. Click OK. The ODI Topology Manager starts.You are now successfully logged in to the ODI TopologyManager.

d. Import ServiceDescription

Click the Topology tab. Click the Repositories tab in the leftpanel of the Topology Manager. Verify that your newlycreated Master repository is in the Repositories window.

a.

Page 17: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 17/449

 

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

Practices for Lesson 2

Chapter 1 - Page 13

b.

Page 18: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 18/449

 

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

Practices for Lesson 2

Chapter 1 - Page 14

c.

Page 19: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 19/449

 

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

Practices for Lesson 2

Chapter 1 - Page 15

d.

5. Use SQL Developer to create the RDBMS schema/user for the Work repository.

Page 20: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 20/449

 

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

Practices for Lesson 2

Chapter 1 - Page 16

Step Screen/Page Description Choices or Values

a. Oracle SQL Developer If not opened, open SQL Developer. Createthe schema by executing the following SQLcommand:

create user snpw1 identified bypassword

default tablespace userstemporary tablespace temp;

Note: You can find this command in the textfile 2-1.txt located in c:\LABS\Text folder.

Click Run.

b. Oracle SQL Developer Grant connect privileges to the newly created

user by executing the following SQLcommand:

grant connect, resource to snpw1;

c. Oracle SQL Developer Run the following command to verify thatuser snpw1 was successfully created andshown among other users in the list:

select * from all_users; 

a.

b.

Page 21: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 21/449

 

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

Practices for Lesson 2

Chapter 1 - Page 17

c.

6. Now that you created the RDBMS schema/user, use ODI Topology Navigator to create theODI Work repository:

Page 22: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 22/449

 

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

Practices for Lesson 2

Chapter 1 - Page 18

Step Screen/PageDescription

Choices or Values

a. Oracle Data Integrator In ODI, click the Topology Navigator  tab and then click tothe Repositories panel.

Right-click the Work Repositories node and select NewWork Repository.

The Create Work Repository Wizard opens.

b. Specify ODI WorkRepository ConnectionProperties

In the screen that follows, enter the parameters shown in thefollowing table. Click the Test button. Verify successfulconnection and click OK.Click Next.

Parameter Value

Technology Oracle

Driver

Name

oracle.jdbc.driver.OracleDriver

JDBC Url jdbc:oracle:thin:@localhost:1521:orcl

User snpw1

Password password 

c. Specify WorkRepository properties

In the Specify Work Repository properties panel, set the IDto “1”. Set the Name to WORKREP_PR2-1. In the Password field, enter SUNOPSIS. In the Work Repository Type field,

leave Development unchanged. Click Finish. Verify thatthe newly created Work repository is now in the workrepositories tree view.

Note: The Development type of repository enablesmanagement of design-time objects such as data modelsand projects (including interfaces, procedures, and so on). Adevelopment repository includes also the run-time objects(scenarios and sessions). This type of repository is suitablefor development environments.

d. Create Work Repository

Login

In the Create Work Repository Login window, click Yes.

Enter the Login name: Work Repository Pr 2-1, as shownin the screen. Click OK.

e. Oracle Data Integrator Verify that Work repository WORKREP_PR2-1 was createdand is shown under the Work Repositories node.

a.

Page 23: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 23/449

 

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

Practices for Lesson 2

Chapter 1 - Page 19

b.

Page 24: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 24/449

 

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

Practices for Lesson 2

Chapter 1 - Page 20

c.

d.

Page 25: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 25/449

 

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

Practices for Lesson 2

Chapter 1 - Page 21

e.

7. Disconnect from the Master repository and connect to the Work repository:

Page 26: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 26/449

 

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

Practices for Lesson 2

Chapter 1 - Page 22

Step Screen/PageDescription

Choices or Values

a. Oracle Data Integrator Click the ODI menu and select Disconnect “MasterRepository Pr 2-1”.

b. Oracle Data Integrator Click “Connect To Repository”.

c. Oracle Data IntegratorLogin

Select “Work Repository Pr 2-1” from the Login Name drop-down list. In the Password field, enter SUNOPSIS.Click OK. Click the Designer  tab. The following ODIDesigner screen appears.

You have now successfully created and connected to the

ODI Work repository.

d. Oracle Data IntegratorLogin

Click ODI menu and select “Disconnect Work repositoryPr 2-1”.

a.

b.

Page 27: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 27/449

 

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

Practices for Lesson 2

Chapter 1 - Page 23

c.

d.

Page 28: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 28/449

 

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

Practices for Lesson 2

Chapter 1 - Page 24

Page 29: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 29/449

 

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

Practices for Lesson 3

Chapter 2 - Page 1

Practices for Lesson 3

Chapter 2

Page 30: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 30/449

 

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

Practices for Lesson 3

Chapter 2 - Page 2

Practice 3-1: Setting Up and Installing an ODI Agent

Use Case Scenario:

John is responsible for data loading, transformation, and validation. He created Master andWork repositories. Now he continues setting up his ODI environment by installing an ODI Agent.

Background:

 A common task that is performed by using ODI is to set up and install ODI Agent as a service. After the ODI scenarios are created, they can be scheduled and orchestrated by using an ODI Agent, which is a lightweight Java process that orchestrates the execution of ODI scenarios. Inthis practice, you create and execute an ODI Agent, which will be used in subsequent practicesfor orchestration of the execution of ODI objects.

First you run encode <password> to generate an encrypted password.

You copy/paste that string into the odiparams.bat  file that contains ODI agent parameters.

You then switch to ODI, and define a physical agent named localagent . Next, you define alogical agent also named localagent , mapping it to the same-named physical agent. You specifythe Global  context as the context in which to make this particular mapping of logical to physicalagents.

In the command window, you execute agent.bat  to start the agent that you named localagent .

In ODI, you test connection to your newly created agent.

The directions on the following pages will take you through these activities:

1. Run encode oracle1 to generate an encrypted password string

2. Edit odiparams.bat, inserting the encrypted password

3. In ODI, define a physical agent named localagent 

4. In ODI, define a logical agent named localagent, mapping it to the physical agent named

localagent for the Global context5. Execute agent.bat, to start an agent named localagent .

6. Verify connection to the newly created agent localagent in ODI

 Your Tasks:

Page 31: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 31/449

 

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

Practices for Lesson 3

Chapter 2 - Page 3

1. Before executing the agent.bat file to create the ODI Agent, you must run the encodepassword command to generate an encrypted password and paste it into the

odiparams.bat parameter file. To do so, perform the following steps:

Step Screen/PageDescription

Choices or Values

a. MS Windows and

text editor

Navigate to the ODI_HOME directory, where ODI is installed

and open the agent\bin subdirectory:(C:\Oracle\Middleware\Oracle_ODI1\oracledi\agent\bin). Navigate to the odiparams.bat file, right-click thisfile, and select Edit to open it with a text editor. Leave this editoropen. You will run a batch file from a Command window andreturn to this text editor to copy the results into theodiparams.bat file.

Explanation: You need to edit the odiparams.bat file to setthe repository connection information for the ODI Agent to use.The password information is stored as an encrypted string. Youwill generate the encrypted string in a Command window.

b. Command Prompt Leave the text editor open, and open the Command window(Start -> Run -> cmd). Change the directory to theODI_HOME\agent\bin directory:

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

c. Command Prompt To generate the encrypted password string, you will be usingthe agent command, encode <password>. Because yourpassword is the word “oracle1”, enter and execute the followingcommand in the Command window:

encode oracle1 

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

Page 32: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 32/449

 

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

Practices for Lesson 3

Chapter 2 - Page 4

Step Screen/PageDescription

Choices or Values

d. Command Promptand text editor

Copy the generated, encrypted password from the Commandwindow (from the Command window’s pull-down menu, selectEdit > Mark, then highlight the password with your mouse) andinsert it into the odiparams.bat file as the value for the

ODI_MASTER_ENCODED_PASS parameter. Verify and, ifnecessary, edit settings for other  parameters from the followingtable, save the odiparams.bat file, and then close it. Theagent’s connectivity is now set up.

Parameter Value

ODI_MASTER_DRIVER oracle.jdbc.OracleDriver

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

ODI_MASTER_USER DEV_ODI_REPO

ODI_MASTER_ENCODED_PASS

Insert your encoded password.

ODI_SECU_WORK_REP WORKREP

ODI_SUPRVISOR_ECODED_PASS

Leave the default value.

ODI_USER Leave the default value. 

ODI_ENCODED_PASS Leave the default value. 

ODI_JAVA_HOME C:\jdk1.6.0_18 

Note

DEV_ODI_REPO is an RDBMS schema/user (Oracle 11g ) forthe Master repository. It was precreated for this and subsequentpractices.

Work Repository name is WORKREP.

Because each time that you encode the password, it receivesdifferent values, your encoded password will differ from the oneprovided in the screen.

Do not  change the default value of the ODI_USER andODI_ENCODED_PASS parameters. Those parameters wereprecoded during ODI installation.

a.

Page 33: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 33/449

 

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

Practices for Lesson 3

Chapter 2 - Page 5

b.

c.

Page 34: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 34/449

 

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

Practices for Lesson 3

Chapter 2 - Page 6

d.

2. Now that you have generated an encoded password and pasted it into theodiparams.bat file, you need to create the ODI physical and logical agent definitions. Tocreate these ODI agent definitions, perform the following steps:

Page 35: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 35/449

 

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

Practices for Lesson 3

Chapter 2 - Page 7

Step Screen/PageDescription

Choices or Values

a. MS Windows

ODI Login

If it is not started, start Oracle Data Integrator. Click “ConnectTo Repository”. Select DEV_ODI_REPO from the Login Namedrop-down list. Click OK.

b. Topology navigator Click Topology Navigator tab. In Topology Navigator, select thePhysical Architecture panel. Right-click the Agents node.Select New Agent.

c. Agent: localagent Fill in the following fields:

Name: localagent

Host: Network name or IP address of the machine the agenthas been launched on. Verify that this parameter is set tolocalhost.

Port: Listening port used by the agent. By default, this port is

20910. Leave the default value.Web Application Context: Name of the Web applicationcorresponding to the Java EE agent deployed on anapplication server. For standalone agents, this field should beset to oraclediagent.

Set Maximum number of sessions supported by this agent to250. Click the Save button. 

d. Topology Navigator

Local Agent: New

Now you have to insert a logical agent in Logical Architecture,and map it to the newly created Physical agent. Click theLogical  Architecture tab. Right-click  Agents and select New

Logical  Agent. On the screen that follows, set the Name to“localagent.” Set Physical Agents to localagent. From thefile menu, click Save, and then close the Logical Agent tab.

a.

Page 36: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 36/449

 

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

Practices for Lesson 3

Chapter 2 - Page 8

b.

c.

d.

Page 37: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 37/449

 

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

Practices for Lesson 3

Chapter 2 - Page 9

3. Now that you have created the agent and defined the ODI physical and logical agents, youcan start the agent directly from the command line.

Step Screen/PageDescription

Choices or Values

a. Command Prompt Switch back to the Command window you left open at theODI _ HOME\agent \bin directory(C:\Oracle\Middleware\Oracle_ODI1\oracledi\agent\bin). Execute the agent.bat file by using the followingcommand:

agent -NAME=localagent

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

Note: This command window should remain open during alllabs.

c. Oracle DataIntegrator

In ODI, click the Test icon to verify connection of the agentlocalagent.

You successfully created and connect to ODI agent. Close the

localagent tab . Also, close the Messages -

Log tab  .

a.

Page 38: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 38/449

 

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

Practices for Lesson 3

Chapter 2 - Page 10

b.

c.

Page 39: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 39/449

 

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

Practices for Lesson 4

Chapter 3 - Page 1

Practices for Lesson 4

Chapter 3

Page 40: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 40/449

 

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

Practices for Lesson 4

Chapter 3 - Page 2

Practice 4-1: Working with Topology

Use Case Scenario:

John created the Master and Work repositories and installed an ODI Agent as a backgroundservice. To complete setting up his ODI infrastructure, he needs to create contexts, a datasever, and physical and logical schemas. 

Background: Before you begin working on your ODI projects, you need to describe your ODIinfrastructure in the topology. As a starting point of this practice, you will use the environmentprovided with the ODI installation. The infrastructure includes several servers. You need todefine the following new data server and its attached physical schemas.

Data Server : ORACLE_ORCL_LOCAL

 Define two of three schemas available in this instance:

Schema Description

SALES_DEV  Schema storing the target tables fordevelopment purposes 

SALES_PROD  Schema storing the production target

tables 

STAGING  Schema used to store ODI temporaryobjects (not used in this practice) 

Both the SALES_DEV and SALES_PROD physical schemas contain identical table structuresand correspond to the same logical schema called ORACLE_ORCL_LOCAL_SALES. Themapping for this logical schema depends on the context.

Note: Completing these tasks is critical for all subsequent practice sessions.

This practice consists of the following six steps:

1. Define the Production context.

2. Define the Development context (a third context, Global, is pre-seeded).

3. Define the ORACLE_ORCL_LOCAL data server.

4. Define the ODI physical schemas for data server: SALES_DEV,SALES_PROD.

5. Define the ORACLE_ORCL_LOCAL_SALES ODI logical schema.

Page 41: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 41/449

 

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

Practices for Lesson 4

Chapter 3 - Page 3

6. Map the logical schema to the two physical schemas, in terms of the three contexts. 

 Your Tasks:

1. If not started, start Oracle Data Integrator and open the DEV_ODI_REPO connection.

Note: The username and password are case-sensitive.

a. Select Start > Programs > Oracle ODI11g-Home > Oracle Data Integrator  > ODIStudio. Click Connect To Repository.

b. Log in with the following details. Click OK.

• Login name: DEV_ODI_REPO 

• User: SUPERVISOR 

• Password: SUNOPSIS 

Page 42: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 42/449

 

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

Practices for Lesson 4

Chapter 3 - Page 4

2. Create a new context:

a. Click the Topology navigator tab, and then click the Context tab.

b. Click the New Context icon on the toolbar, and then select New Context.

c. Enter your context parameters as shown below. The context window should appear as

follows. Click the Save button .

•  Name: Production 

•  Code: PRODUCTION 

•  Password: Leave this field empty.

•  Default: Select this check box, and click Yes to confirm in the pop-up window.

Page 43: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 43/449

 

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

Practices for Lesson 4

Chapter 3 - Page 5

d. To create another new context , repeat the operations:

Name: Development 

Code: DEVELOPMENT 

Password: Leave this field empty.

Default: Leave the check box deselected.

The contexts should appear as follows:

3. Create an ORACLE_ORCL_LOCAL data server:

a. Click the Physical Architecture tab. Expand the Technologies node, select theOracle node, and then right-click and select New Data Server .

Page 44: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 44/449

 

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

Practices for Lesson 4

Chapter 3 - Page 6

b. Enter the following information on the Definition tab:

• Name: ORACLE_ORCL_LOCAL 

• Instance Name: ORCL 

• User: ODI 

• Password: ODI 

Page 45: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 45/449

 

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

Practices for Lesson 4

Chapter 3 - Page 7

c. Click the JDBC tab. Click the button at the right of the JDBC Driver  field. In thewindow that appears, select Oracle JDBC Driver , and then click OK.

d. Click the button to the right of the JDBC URL field. In the window that appears,

select the first URL, and then click OK.

Page 46: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 46/449

 

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

Practices for Lesson 4

Chapter 3 - Page 8

e. Edit the JDBC URL to have the following:

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

The JDBC tab should now appear as follows:

4. Test this data server:

a. Click the Test Connection button. Click Yes to confirm saving your data before testingthe connection. In the Information window, click OK.

Page 47: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 47/449

 

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

Practices for Lesson 4

Chapter 3 - Page 9

b. In the dialog box that appears, click the Test button. Click OK.

5. Create a physical schema for this data server: ORACLE_ORCL_LOCAL.SALES_DEV withthe following parameters:

• Data Schema: SALES_DEV 

• Work Schema: STAGING 

• Default check box: Selected  

a. Expand the Oracle node. Right-click the newly created data server,

ORACLE_ORCL_LOCAL, and then select New Physical Schema.

Page 48: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 48/449

 

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

Practices for Lesson 4

Chapter 3 - Page 10

b. In the new window that appears, select SALES_DEV from the Schema (Schema) drop-down list, and then select STAGING from the Schema (Work Schema) drop-down list. Verify that the Default check box is selected, and leave all the other fields

unchanged. Click the Save button . Click OK in the Information window thatappears.

Page 49: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 49/449

 

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

Practices for Lesson 4

Chapter 3 - Page 11

c. Expand: Oracle > ORACLE_ORCL_LOCAL. The Physical schemaORACLE_ORCL_LOCAL.SALES_DEV appears in the tree view:

6. Create a physical schema ORACLE_ORCL_LOCAL.SALES_PROD for the

ORACLE_ORCL_LOCAL data server:

• Data Schema: SALES_PROD • Work Schema: STAGING 

• Default Schema: Not  selected

a. Select the ORACLE_ORCL_LOCAL data server in the tree view, and then right-clickand select New Physical Schema.

b. In the new window that appears, select SALES_PROD from the Schema (Schema) drop-down list, and then select STAGING from the Schema (Work Schema) drop-

Page 50: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 50/449

 

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

Practices for Lesson 4

Chapter 3 - Page 12

down list. Check that the Default check box is not selected, and leave all the other

fields unchanged. Click the Save button . In the Information window, click OK.

7. Create a logical schema, ORACLE_ORCL_LOCAL_SALES, and map this schema to differentphysical schemas, for the different contexts.

• Development Context: To the ORACLE_ORCL_LOCAL.SALES_DEV physical schema

• Production Context: To the ORACLE_ORCL_LOCAL.SALES_PROD physical schema

• Global Context: To the ORACLE_ORCL_LOCAL.SALES_DEV physical schema

a. Select the Logical Architecture tab and expand the Technologies node. Select theOracle node, and then right-click and select New Logical Schema.

Page 51: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 51/449

 

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

Practices for Lesson 4

Chapter 3 - Page 13

b. Enter the name of the logical schema ORACLE_ORCL_LOCAL_SALES. To map thislogical schema to physical schemas in different contexts, select the appropriatephysical schema in front of each context, as shown in the following screen. Click theSave button.

8. The logical schema FILE_DEMO_SRC is predefined for you and is mapped in the Globalcontext to a physical schema that represents a subfolder in a file system. MapFILE_DEMO_SRC to the same physical schemas in the Development and Productioncontexts.

a. In the Logical Architecture, expand the File node, and double-click theFILE_DEMO_SRC logical schema. Ensure that the logical schema FILE_DEMO_SRCis mapped to the physical schemas in the Development, Global, and Productioncontexts, as follows. Click the Save button.

Page 52: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 52/449

 

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

Practices for Lesson 4

Chapter 3 - Page 14

b. Repeat the previous step for the following logical schemas:

• In XML technology, the logical schema XML_DEMO_GEO should be mapped to thephysical schema XML_DEMO_DIM.GEO, as follows.

• In Hypersonic SQL, the logical schema HSQL_DEMO_SRC should be mappedto the physical schema HSQL_LOCALHOST_20001_Default in all contexts.

Page 53: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 53/449

 

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

Practices for Lesson 4

Chapter 3 - Page 15

• In Hypersonic SQL, the logical schema HSQL_DEMO_TARG should be mappedto the physical schema HSQL_LOCALHOST_20002_Default, as follows.

Note: Ensure that these mappings are similar in the three contexts. Close all the tabs, asshown:

9. You set up ODI agent localagent in Practice 3-1. Link the Logical agent to the Physicalagent in all three contexts and test the connection.

a. In the Physical Architecture, open the Physical agent localagent. Similarly, open theLogical agent, localagent, in the Logical Architecture. Ensure that this Logical agent,localagent, is linked to Physical agent localagent in all three contexts as follows.

Page 54: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 54/449

 

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

Practices for Lesson 4

Chapter 3 - Page 16

Save your changes.

b. In the physical agent’s localagent tab, click Test, and verify successful connection.Click OK, and then close all the tabs.

Page 55: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 55/449

 

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

Practices for Lesson 4

Chapter 3 - Page 17

Page 56: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 56/449

 

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

Practices for Lesson 4

Chapter 3 - Page 18

Page 57: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 57/449

 

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

Practices for Lesson 5

Chapter 4 - Page 1

Practices for Lesson 5

Chapter 4

Page 58: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 58/449

 

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

Practices for Lesson 5

Chapter 4 - Page 2

Practice 5-1: Creating a Model

Use Case Scenario:

John created a new ODI project and imported knowledge modules that will be used fordevelopment of his integration project. Now, John needs to create new ODI Models andreverse- engineer all tables and files in the models.

Background: 

In the previous practice, you configured the schemas containing the application datastored inthe Oracle database. You now create the Oracle Sales Application model correspondingto this data and reverse-engineer the schemas’ data structures. You also reverse-engineer thestructure of an XML file to a Geographic Information model that you define.

 Your Tasks:

1. Start the ODI Demo source environment: Select: Start > Programs > Oracle ODI 11g-Home> Oracle Data Integrator > Shortcut to startdemo.  If the Open File – Security Warningwindow appears, click Run. The “Oracle DI Demo – Source” command shell window opens.

Page 59: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 59/449

 

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

Practices for Lesson 5

Chapter 4 - Page 3

Note: You should have this command shell window running during all the labs.

2. Create a model for the Oracle schema.

a. In Designer, select the Models tab.

b. Click the New Model icon and then select New Model.

c. Specify (enter or select) the following parameters on the Definition tab:• Name: Oracle Sales Application

• Code: ORACLE_SALES_APPLICATION

• Technology: Oracle

• Logical Schema: ORACLE_ORCL_LOCAL_SALES

The Definition tab should appear as shown:

Page 60: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 60/449

 

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

Practices for Lesson 5

Chapter 4 - Page 4

d. Click the Reverse Engineer tab, and then select Development from the Context drop-

down list. Click the Save button.

3. Reverse-engineer all the tables in this model.

a. Right-click Oracle Sales Application model and select the Reverse Engineer option. Ifthe Confirmation window appears, click Yes.

Note: The progress of the reverse engineering process is shown on the status bar.

Page 61: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 61/449

 

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

Practices for Lesson 5

Chapter 4 - Page 5

b. Verify the model reverse-engineered successfully. In the tree view, expand the Oracle Sales  Application model. The datastores of the model appear.

Expand the TRG_CUSTOMER datastore, and then expand the Columns and Constraintsnodes. The list of columns and constraints that were reverse engineered for this tableappear in the tree view. Check that the columns and constraints that were reverse

Page 62: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 62/449

 

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

Practices for Lesson 5

Chapter 4 - Page 6

engineered for the TRG_CUSTOMER table correspond to its data definition language(DDL) given below. Close the tabs.

create table TRG_CUSTOMER (

CUST_ID NUMERIC(10) not null,DEAR VARCHAR(4),

CUST_NAME VARCHAR(50),

 ADDRESS VARCHAR(100),

CITY_ID NUMERIC(10) not null,

PHONE VARCHAR(50),

 AGE NUMERIC(3),

 AGE_RANGE VARCHAR(50),

SALES_PERS VARCHAR(50),

CRE_DATE DATE,

UPD_DATE DATE,constraint PK_TRG_CUSTOMER primary key (CUST_ID),

constraint FK_CUST_CITY foreign key (CITY_ID)

references TRG_CITY (CITY_ID));

Note: The constraint called FK_SALES_CUST TRG_SALES is defined on another table. As it references TRG_CUSTOMER, it also appears here. 

Page 63: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 63/449

 

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

Practices for Lesson 5

Chapter 4 - Page 7

4. Create a model for an XML file.

a. Click the New Model icon and then select New Model.

b. Specify (enter or select) the following parameters on the Definition tab:

• Name: Geographic Information

• Code: GEOGRAPHIC_INFORMATION

• Technology: XML

• Logical Schema: XML_DIM_GEO 

c. The Definition tab should appear as below. Click the Reverse Engineer tab.

d. Select Development from the Context drop-down list. Click the Save button.

Page 64: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 64/449

 

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

Practices for Lesson 5

Chapter 4 - Page 8

5. Reverse-engineer all the tables in this model.

a. In the Models tree view, right-click Geographic Information model and select theReverse Engineer option.

Note: The progress of the reverse engineering process is shown on the status bar.

b. Verify that the model reverse-engineered successfully. In the tree view, expand theGeographic Information model. The datastores of the model appear.

Page 65: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 65/449

 

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

Practices for Lesson 5

Chapter 4 - Page 9

6. Open the XML file GEO_DIM.xml corresponding to the XML model that you have reverse-engineered. The file is at the following location:C:\Oracle\Middleware\Oracle_ODI1\oracledi\demo\xml 

a. Open Windows Explorer, and go to theC:\Oracle\Middleware\Oracle_ODI1\oracledi\demo\xml directory.

b. Right-click the GEO_DIM.xml file and select Open.

c. The XML file opens in Internet Explorer. The file structure appears as shown here:

The file hierarchy is GEOGRAPHY_DIM > country > region > city > and so on..

7. Compare the XML file content with the reverse-engineered structure in the Hierarchicalview. In Designer’s tree view, expand the Geographic Information node, and then theHierarchy node. Expand the datastores under this node.

The hierarchy of the XML file is reproduced here. The XML file has been mapped to arelational structure, with foreign keys to map the links between the different levels of

hierarchy. Close the Geographic Information model tab .

Page 66: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 66/449

 

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

Practices for Lesson 5

Chapter 4 - Page 10

Page 67: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 67/449

 

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

Practices for Lesson 6

Chapter 5 - Page 1

Practices for Lesson 6

Chapter 5

Page 68: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 68/449

 

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

Practices for Lesson 6

Chapter 5 - Page 2

Practice 6-1: Setting Up a New ODI Project

Use Case Scenario:

John is responsible for an integration project, which includes data loading, transformation, andvalidation. He created contexts, a data sever, and physical and logical schemas in theTopology. To start an integration project, John needs to create a new ODI project and importknowledge modules that will be used for development of his project. 

Background: 

Now you assume the role of a project leader who is starting an integration project.

You create a project named HandsOnLoads with a folder named HandsOn. You importknowledge modules for working with three sources (Hypersonic SQL, XML, and File) and onetarget (Oracle.)

Note: Completing this practice is critical for all the following practice sessions.

 Your Tasks:

1. Create a project, HandsOnLoads, with a folder called HandsOn.

a. In Designer Navigator select Projects tab, click the New Project icon, and thenselect New Project.

b. Enter the name of the project: HandsOnLoads. The code is automatically generated.

Page 69: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 69/449

 

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

Practices for Lesson 6

Chapter 5 - Page 3

c. Click the Save button to create the project. The project appears in the tree view.Expand the HandsOnLoads project node.

d. ODI creates a folder called FirstFolder. Double-click this folder. In the editing windowthat appears, edit the folder in the Name field, HandsOn. Click the Save button.

Page 70: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 70/449

 

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

Practices for Lesson 6

Chapter 5 - Page 4

2. Import the knowledge modules required for working with the following technologies:

• Sources:

• Hypersonic SQL

• XML

• File

• Targets• Oracle

a. Select the HandsOnLoads project node. Right-click, and then select Import > ImportKnowledge Modules.

Page 71: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 71/449

 

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

Practices for Lesson 6

Chapter 5 - Page 5

b. The Import Knowledge Modules window appears. Click the button.

c. Navigate to C:\Oracle\Middleware\Oracle_ODI1\oracledi\xml-reference,and then click Open. A list of knowledge modules appears.

Page 72: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 72/449

 

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

Practices for Lesson 6

Chapter 5 - Page 6

d. Select the following knowledge modules that are used in this project. Use the Ctrl keyfor multiple selections. Click OK. In the screen that follows, click Close.

• CKM HSQL

• CKM Oracle

• IKM Oracle Incremental Update

• IKM SQL Control Append

• LKM File to SQL

• LKM SQL to Oracle

e. Review Import Report, and then close it.

Page 73: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 73/449

 

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

Practices for Lesson 6

Chapter 5 - Page 7

f. Check the imported knowledge modules by expanding corresponding nodes underHandsOnLoads > Knowledge Modules, as shown here:

Page 74: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 74/449

 

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

Practices for Lesson 6

Chapter 5 - Page 8

Close the HandsOnLoads and HandsOn tabs.

Page 75: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 75/449

 

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

Practices for Lesson 7

Chapter 6 - Page 1

Practices for Lesson 7

Chapter 6

Page 76: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 76/449

 

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

Practices for Lesson 7

Chapter 6 - Page 2

Practice 7-1: Checking Data Quality in the Model

Use Case Scenario:

John created new ODI Models and reverse-engineered all the tables and files in the models.Now, John needs to check the quality of data in the models, define the constraints on themodels, and detect possible errors in data.

Background:

 After the models are defined, you need to check the quality of the data in these models. In thispractice, you check the quality of data in the models and define constraints on models for thegiven sample application.

First you create a new model, HSQL_ORDERS_APPLICATION, as a duplicate of the model

HSQL_SRC.

You then create a referential constraint on the SRC_CUSTOMER table's CITY_ID column, usingSRC_CITY as the parent table.

Next, you create a condition constraint on the SRC_CUSTOMER table:

Length(SRC_CUSTOMER.PHONE) > 6

Note: Completing this practice is critical for all the following practice sessions.

 Your Tasks:

1. Create a new model, HSQL_ORDERS_APPLICATION, as a duplicate of the model

HSQL_SRC.

a. In Designer, open the Models tab. Right-click HSQL_SRC model and select Duplicateselection to duplicate the datastore. Click Yes.

Page 77: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 77/449

 

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

Practices for Lesson 7

Chapter 6 - Page 3

b. Open the Copy of the HSQL_SRC model and rename it as HSQL Orders Application.For Code, enter HSQL_ORDERS_APPLICATION. Click Save to save the model. Ifyou get a warning message, click Yes to finish saving.

Page 78: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 78/449

 

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

Practices for Lesson 7

Chapter 6 - Page 4

2. Create a Reference constraint between the SRC_CUSTOMER and SRC_CITY datastores inthe new model. This reference is on the CITY_ID column.

a. Expand the HSQL Orders Application model, and expand the SRC_CUSTOMERdatastore.

Page 79: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 79/449

 

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

Practices for Lesson 7

Chapter 6 - Page 5

b. Select the Constraints node, right-click, and select the New Reference option.

c. From the Table drop-down list, select the SRC_CITY table. The name of the constraintis automatically generated. Click the Columns tab.

Page 80: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 80/449

 

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

Practices for Lesson 7

Chapter 6 - Page 6

d. Click the Add icon, and use drop-down lists to select the CITY_ID column for bothtables of reference. (Note that the Primary Table column is City, which you want toalso change to CITY_ID.) Click the Save button.

3. Create a Condition constraint on SRC_CUSTOMER to check that the phone number containssix or more characters.

a. Select the Constraints node again for SRC_CUSTOMER, right-click, and select the New Condition option.

•  Enter “Phone Number  Length” in the Name field.

•  Select Oracle Data Integrator Condition from the Type drop-down list.

•  Enter the following expression in the Where field:

o  LENGTH(SRC_CUSTOMER.PHONE) > 6.

•  In the Message field, enter “A phone number should contain more than 6characters”.

Note: You can also use the Expression Editor icon to graphically edit theexpression.

Page 81: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 81/449

 

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

Practices for Lesson 7

Chapter 6 - Page 7

b. Click the Validation icon to validate your expression syntax.

c. On the Oracle Data Integration Information screen, click OK. Click the Save button toadd the condition, and the close the tab.

4. Run a static check on the HSQL Orders Application model.a. Select the HSQL Orders Application model tab and click Control tab.

Page 82: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 82/449

 

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

Practices for Lesson 7

Chapter 6 - Page 8

b. Select Knowledge Module CKM HSQL.HandsOnLoads. Click the Save button. Closethe HSQL Orders Application model tab.

5. Select the HSQL Orders Application model in the tree view, right-click, and select Control >Check.

a. In the Execution dialog box, select Development context and then click OK.

b. Click OK when the Information dialog box notifies you that the session has started.

Page 83: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 83/449

 

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

Practices for Lesson 7

Chapter 6 - Page 9

6. Click the Operator Navigator icon tab . The Operator window appears. Clickthe Hierarchical Sessions tab. Expand the All Executions node. Expand the HSQL Orders

 Application session. Expand its Steps node. The session should appear complete,containing steps marked with check marks and warnings, as shown here.

Note: You can optionally review the content of this session and see the different SQLcommands issued to perform the check operations.

Page 84: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 84/449

 

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

Practices for Lesson 7

Chapter 6 - Page 10

7. Review the errors detected in the SRC_CUSTOMER datastore.

a. Click the Designer Navigator tab. In the Designer window, expand the HSQL Orders Application model, select the SRC_CUSTOMER datastore, right-click, and selectControl > Errors.

b. View the table that lists the errors detected in your table. You have one join error andseven invalid phone numbers. Each line also contains the content of the invalid record.

c. Verify the following:

• How many customers have an invalid CITY_ID? (1)

• How many customers have invalid phone number? (7)d. Close these tabs.

Page 85: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 85/449

 

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

Practices for Lesson 8

Chapter 7 - Page 1

Practices for Lesson 8

Chapter 7

Page 86: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 86/449

 

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

Practices for Lesson 8

Chapter 7 - Page 2

Practice 8-1: Creating ODI Interface: Simple Transformations

Use Case Scenario:

John created the new ODI models and reverse-engineered all the tables and files in the models,defined the constraints on the models, and checked data quality. Now, John begins working oncreating ODI Interfaces to pass data between models and perform simple data transformations.These interfaces will then be used for the development of his integration project.

Background:

 After the models are defined and the quality of the data is verified, you need to create an ODIInterface to perform transformations. In this practice, you create simple interfaces with onetarget table and a single source. You will run these interfaces and check the execution.

In this practice, you create three interfaces. First, you create an interface called INT_8-1,loading the TRG_COUNTRY datastore in the Oracle Sales Application model with the content ofthe SRC_REGION table from the HSQL Orders Application model. This simple interface has notransformations.

The second interface, INT_8-2, is a duplicate of INT_8-1, to which flow control is activated,and constraints in the target table are checked.

The third interface,INT_8-3

, loads theTRG_COUNTRY

 datastore in the Oracle Sales Application model with the content of the SRC_CITY table from the HSQL Orders Applicationmodel. In this interface, flow control is activated, constraints in the target table are checked,and city population values are transformed from individual to times 1,000.

Note: Completing this practice is critical for other practice sessions. 

 Your Tasks:

Page 87: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 87/449

 

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

Practices for Lesson 8

Chapter 7 - Page 3

1. Create an interface called INT_8-1, loading the TRG_COUNTRY datastore in the OracleSales Application model with the content of the SRC_REGION table from the HSQL Orders

 Application model. You must map the columns of the same name without anytransformation. Ensure that you take only distinct records.

a. In Designer, click the Projects tab, and expand the HandsOnLoads project. Expand theHandsOn folder. Select the Interfaces node, right-click, and select the New Interfaceoption.

b. In the Interface window, enter INT_8-1 as the name of the interface. Ensure that theOptimization Context is Global. Click the Mapping tab.

c. In the Designer Navigator to the left, click the Models tab. In the tree view, expand the

Oracle Sales Application model. Drag the TRG_COUNTRY datastore from the treeview to the Target Datastore zone (see the following screen: the panel to the right  ofthe panel with text stating “Drag datastores…. as sources for this dataset”). Thedatastore appears in this zone.

Page 88: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 88/449

 

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

Practices for Lesson 8

Chapter 7 - Page 4

d. Expand the HSQL Orders Application model and drag the SRC_REGION datastore from the model tree to the Sources zone of your diagram (the panel to the left  of thetarget panel). An Automap dialog box appears. Click Yes. Now the systemautomatically maps fields in the source and target datastores.

Page 89: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 89/449

 

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

Practices for Lesson 8

Chapter 7 - Page 5

e. Click the Flow tab. After the flow diagram initializes, you may want to use the zoom-outbutton to see all the objects in the diagram. Click the box for Target + Staging  Area thatis labeled Target (ORACLE_ORCL_LOCAL), and then in the Target Properties panel,

select the Distinct Rows check box. If open, click the button to minimize theMessages log. Your screen now looks as shown here.

Note: Confirm that the Distinct Rows check box is selected.

Page 90: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 90/449

 

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

Practices for Lesson 8

Chapter 7 - Page 6

f. Click the Save button to save your interface. If the Locking Object window appears,select “Don’t show this window next time,” and click Yes.

2. Run this interface, and check the content of the TRG_COUNTRY table.

a. Expand the Interfaces node, right-click the newly created interface INT_8-1, and thenselect Execute.

Page 91: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 91/449

 

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

Practices for Lesson 8

Chapter 7 - Page 7

b. Click OK in the Execution window, and then click OK when the Session Startedmessage appears.

c. Click the Operator tab to open the ODI Operator Navigator. The Operator windowappears.

Note: In Operator, you may need to click the Refresh button to view the newsession.

Page 92: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 92/449

 

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

Practices for Lesson 8

Chapter 7 - Page 8

d. In the Session List tab, expand the All Executions node. The session called “INT_8-1”should appear complete. Expand this session in the tree view as shown:

e. In your interface window, click the Mapping tab. In Target datastore – TRG_COUNTRY, right-click COUNTRY, and then select Data.

f. A window appears with the loaded data.

Page 93: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 93/449

 

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

Practices for Lesson 8

Chapter 7 - Page 9

g. Verify your data and close this window. Close INT_8-1 tab. If the Unlocking Objectwindow appears, select “Don’t show this window next time” check box and click Yes.

3. Create an interface called INT_8-2 that loads the TRG_REGION datastore in the OracleSales Application model with the content of the SRC_REGION table from the Orders

 Application–HSQL model. You must map the columns of the same name without anytransformation. Ensure that flow control is activated and all constraints in the target tableare checked.

Note: Because this new interface uses the same source as the previous one, you willduplicate it.

a. Select the Designer tab. If not open, click the Projects tab and select the INT_8.1interface. Right-click and select Duplicate Selection, and then click Yes in theconfirmation box. A copy of your interface appears.

Page 94: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 94/449

 

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

Practices for Lesson 8

Chapter 7 - Page 10

b. Double-click the interface Copy of INT_8.1 to edit it.

c. In the Name field, change the name to INT_8-2 and then click the Mapping tab.

Page 95: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 95/449

 

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

Practices for Lesson 8

Chapter 7 - Page 11

d. Click the “perform layout” button to customize the view of the Source zone. In theConfirmation window, click Yes.

e. In the Designer, click the Models tab, and then drag the TRG_REGION datastore fromthe Oracle Sales Application model to the Target Datastore zone. Leave the sourcedatastore unchanged. Click Yes to perform automatic mapping.

Page 96: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 96/449

 

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

Practices for Lesson 8

Chapter 7 - Page 12

f. Click the Flow tab. In the diagram, click the box labeled Target(ORACLE_ORCL_LOCAL). In the Target Properties section, scroll down the IKMoption list to FLOW_CONTROL, and ensure that it is set to “true”.

Page 97: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 97/449

 

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

Practices for Lesson 8

Chapter 7 - Page 13

g. Click the Controls tab. Ensure that the selected KM is CKM Oracle. The value foreach Constraint should be “true”.

Page 98: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 98/449

 

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

Practices for Lesson 8

Chapter 7 - Page 14

h. Click the Save button to save your interface.

4. Run this interface, and check the content of the TRG_REGION table.

a. Click the Execute button.

b. Click OK in the Execution window, and then click OK when the Session Startedmessage appears.

Page 99: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 99/449

 

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

Practices for Lesson 8

Chapter 7 - Page 15

5. In ODI Operator verify that your new interface executed successfully:

a. In the Interface window, click the Mapping tab. Select the TRG_REGION targetdatastore (click the name of the datastore), right-click, and select Data. A windowappears with the loaded data.

Page 100: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 100/449

 

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

Practices for Lesson 8

Chapter 7 - Page 16

b. Verify the data, close this window, and then close your interface INT_8-2.

6. Create an interface called INT_8-3 that loads the TRG_CITY datastore in the Oracle Sales Application model with the content of the SRC_CITY table from the HSQL Orders Application model. Ensure that flow control is activated and all constraints in the targettable are checked. You need to transform the city population values because the targettable unit is “thousands of inhabitants,” whereas the source table unit is “inhabitants.”

a. If not open, select the Designer tab, click the Projects tab, and then the Interfaces

node. Right-click and select New Interface.

Page 101: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 101/449

 

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

Practices for Lesson 8

Chapter 7 - Page 17

b. In the Interface: NEW window, enter INT_8-3, and then click the Mapping tab.

c. If not open, click the Models tab. In the tree view, expand the Oracle Sales Applicationmodel. Drag the TRG_CITY datastore from the tree view to the Target Datastore zone.The datastore appears in this zone.

Page 102: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 102/449

 

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

Practices for Lesson 8

Chapter 7 - Page 18

d. Expand the HSQL Orders Application model and drag the SRC_CITY datastore fromthe model tree to the Sources zone of your diagram. Click Yes to perform Automatic

Mapping.

Page 103: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 103/449

 

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

Practices for Lesson 8

Chapter 7 - Page 19

e. Select the POPULATION column in the target datastore.

f. In the Mapping Properties section of the Property Inspector, in the Implementation tab,edit the expression to populate the POPULATION column with the number ofthousands of inhabitants rounded to the nearest thousand. Edit the expression to havethe following: FLOOR(SRC_CITY.POPULATION/1000)

Note: You use the FLOOR function to perform rounding. 

Page 104: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 104/449

 

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

Practices for Lesson 8

Chapter 7 - Page 20

g. To verify the expression, click Check the Expression in the RDBMS button . ClickOK.

h. Click the Flow tab. Click the box labeled Target (ORACLE_ORCL_LOCAL). In theTarget Properties, scroll down the IKM option list to FLOW_CONTROL, and ensurethat it is set to “true”.

Page 105: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 105/449

 

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

Practices for Lesson 8

Chapter 7 - Page 21

i. Click the Controls tab. Ensure that the selected CKM is CKM Oracle. The value foreach Constraint should be “true”. Click the Save button to save your interface. Closeyour interface editor tab.

Page 106: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 106/449

 

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

Practices for Lesson 8

Chapter 7 - Page 22

7. Run this interface, and check the content of the TRG_CITY table.

a. In the Designer Projects tab, right-click interface INT_8-3, and then select Execute.

b. Click OK in the Execution window, and then click OK when the “Session started”message appears.

Page 107: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 107/449

 

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

Practices for Lesson 8

Chapter 7 - Page 23

c. Open the Operator Navigator  and verify that your interface session executedsuccessfully:

Note: In Operator, you may need to click the Refresh button .

Page 108: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 108/449

 

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

Practices for Lesson 8

Chapter 7 - Page 24

d. In the Designer Navigator , open the Models tab. In the Oracle Sales Application model, right-click the TRG_CITY datastore and select the Data option. A windowappears with the loaded data. Scroll down and view the total number of loaded recordsand loaded data.

Page 109: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 109/449

 

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

Practices for Lesson 8

Chapter 7 - Page 25

e. Verify the data, and then close this window.

Note: The POPULATION column should show thousands of inhabitants.

Page 110: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 110/449

 

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

Practices for Lesson 8

Chapter 7 - Page 26

Page 111: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 111/449

 

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

Practices for Lesson 9

Chapter 8 - Page 1

Practices for Lesson 9

Chapter 8

Page 112: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 112/449

 

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

Practices for Lesson 9

Chapter 8 - Page 2

Practice 9-1: Creating ODI Interface: Complex Transformations

Use Case Scenario:

John created the interfaces to pass data between models and perform simple ELTtransformations. Now John needs to create a more complex interface to load data in the targetmodel from different sources. He also needs to perform some data transformation and filtering,and provide a date when data was updated.

Background:

In the previous practices, you learned how to create a simple ODI Interface.

In this practice, you create a more complex interface with several sources to load theTRG_CUSTOMER datastore in the Oracle Sales Application model with the content ofSRC_CUSTOMER table and the SRC_SALES_PERSON files from different models. You applyfiltering to retrieve only customers with CUST_ID < 105. In addition, you populate the updatedate (UPD_DATE) column with the System date in the mapping implementation field.

Note: Completing this practice is critical for all the following practice sessions.

 Your Tasks:

1. Create an interface called INT_9-1, loading the TRG_CUSTOMER datastore in the OracleSales Application model.

a. In ODI Designer, click the Projects tab, and then the Interfaces node. Right-click andselect New Interface.

Page 113: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 113/449

 

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

Practices for Lesson 9

Chapter 8 - Page 3

b. In the “Interface: NEW” window, enter INT_9-1, set Optimization Context to

Development, and then click the Mapping tab.

c. In the Designer Navigator, click the Models tab, and then in the tree view expand theOracle Sales Application model. Drag the TRG_CUSTOMER datastore from the treeview to the Target Datastore zone. The datastore appears in this zone.

Page 114: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 114/449

 

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

Practices for Lesson 9

Chapter 8 - Page 4

d. In the Design Navigator Models tab, expand the FLAT_FILE_SRC model. Drag theSRC_SALES_PERSON datastore to the Sources zone of your diagram.

Page 115: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 115/449

 

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

Practices for Lesson 9

Chapter 8 - Page 5

e. In the Design Navigator Models tab, expand the HSQL Orders Application model anddrag the SRC_CUSTOMER datastore to the Sources zone of your diagram. Click Yes to perform Automatic mapping. If necessary, rearrange the datastores. Your diagramshould resemble the following:

Page 116: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 116/449

 

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

Practices for Lesson 9

Chapter 8 - Page 6

.

f. Drag the SALES_PERS_ID column from the SRC_CUSTOMER source datastore ontothe ID column of the SRC_SALES_PERSON datastore. A join appears between these

two sources.

Page 117: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 117/449

 

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

Practices for Lesson 9

Chapter 8 - Page 7

g. Select and drag the CUSTID column from the SRC_CUSTOMER source datastore tothe CUST_ID column in the TRG_CUSTOMER target datastore. Select the CUST_ID column in the Target Datastore zone. The Mapping Properties panel shows themapping.

Page 118: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 118/449

 

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

Practices for Lesson 9

Chapter 8 - Page 8

Note: Ensure that the Active Mapping check box is selected  for the CUST_ID column ofthe target datastore.

h. Select the CUST_NAME column in the Target Datastore zone. The MappingProperties panel changes to show an empty mapping.

Note: You may find it useful to select the Freeze View button before you perform thenext step.

i. Drag the FIRST_NAME and LAST_NAME columns from the SRC_CUSTOMER source into the Mapping: CUST_NAME Implementation Tab field, and then edit themapping to have the following mapping expression:

INITCAP(SRC_CUSTOMER.FIRST_NAME) || ' ' ||

INITCAP(SRC_CUSTOMER.LAST_NAME)

Note: Ensure that the Active Mapping check box is selected  for the CUST_NAME columnof the target datastore. 

Page 119: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 119/449

 

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

Practices for Lesson 9

Chapter 8 - Page 9

 j. Scroll down and select the Staging Area button on the Execute on panel.

Note: If the Thumbnail  window is open, close it to extend the Mapping  panel

Page 120: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 120/449

 

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

Practices for Lesson 9

Chapter 8 - Page 10

k. Drag the LAST_NAME column from the SRC_SALES_PERSON source datastore to the

SALES_PERS column in the target datastore. Click the SALES_PERS column in thetarget datastore, and then edit the mapping to have the following mapping expression:UPPER(TES.LASTNAME). Click the Staging Area option from the Execute on panel.

Page 121: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 121/449

 

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

Practices for Lesson 9

Chapter 8 - Page 11

l. Select the UPD_DATE column in the Target Datastore zone and enter the SYSDATE inthe Mapping implementation field. Click the UPD_DATE column again, and then selectthe Staging Area option from the Execute on panel.

Note: Ensure that the Active Mapping check box is selected  for the UPD_DATE column of the target datastore.

Page 122: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 122/449

 

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

Practices for Lesson 9

Chapter 8 - Page 12

m. Repeat step l for the CRE_DATE column. Because the value of the CRE_DATE columnshould not be changed later, deselect the Update check box. Ensure that the StagingArea option is selected from the Execute on panel.

Page 123: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 123/449

 

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

Practices for Lesson 9

Chapter 8 - Page 13

n. In the diagram, drag the CUSTID column from the SRC_CUSTOMER source to theworkbench (the gray background). A filter appears with the CUST_ID column name.

Page 124: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 124/449

 

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

Practices for Lesson 9

Chapter 8 - Page 14

o. Edit the filter expression to have SRC_CUSTOMER.CUSTID < 105. Scroll down andensure that the Source option from the Execute on panel is selected.

Page 125: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 125/449

 

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

Practices for Lesson 9

Chapter 8 - Page 15

p. Click the Flow tab. Click SrcSet1 (FILE_GENERIC). In the Source Set Properties,select LKM File to SQL.

Page 126: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 126/449

 

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

Practices for Lesson 9

Chapter 8 - Page 16

q. In the Flow tab, click the Target datastore. In the Target Properties panel, set theoption DELETE_ALL to the value “true” as shown next. Click the Save button to savethe interface.

Note: By setting “DELETE_ALL” to “true”, you ensure that the table is cleared beforeyou populate it with new data.

Page 127: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 127/449

 

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

Practices for Lesson 9

Chapter 8 - Page 17

2. Run this interface, and check the content of the TRG_CUSTOMER table.

a. In the Projects tab, select interface INT_9-1. Click the Execute button .

b. Click OK in the Execution window, and then click OK when the “Session started”message appears. Open Operator, and verify that your Interface executedsuccessfully.

Note: In ODI Operator Navigator, you may need to click the Refresh icon .

Page 128: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 128/449

 

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

Practices for Lesson 9

Chapter 8 - Page 18

c. Return to Designer, click the Mapping tab, and select the TRG_CUSTOMER targetdatastore (click the name of the datastore). Right-click and select the Data option. Awindow appears with the loaded data.

Page 129: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 129/449

 

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

Practices for Lesson 9

Chapter 8 - Page 19

d. Close this window, and then close your interface.

Page 130: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 130/449

 

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

Practices for Lesson 9

Chapter 8 - Page 20

Practice 9-2: Creating ODI Interface: Implementing Lookup

Use Case Scenario:

John created an interface to load data in the target model from different sources and performdata transformation and, filtering, and provided a date when data was updated. Now Johnneeds to implement a lookup to fetch additional information for the data loading in the target.

Background:

In the previous practices, you created an interface with several sources to load theTRG_CUSTOMER datastore in the Oracle Sales Application model with the content of theSRC_CUSTOMER table and the SRC_SALES_PERSON files from different models. Now youimplement the lookup to load data in the target according to the age range provided in thelookup table.

Note: Completing this practice is critical for all the following practice sessions.

 Your Tasks:

1. Create an ODI Interface with a new lookup.

a. In the Designer, duplicate interface INT_9-1. Open the copy of INT_9-1 and renamethe interface INT_9-2. Ensure that the Staging Area Different From Target check

box is deselected. Click the Mapping tab.

Page 131: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 131/449

 

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

Practices for Lesson 9

Chapter 8 - Page 21

b. In the Mapping tab, click the button to arrange the datastores in the source pane.

In the Confirmation window, click Yes. Click the Add a new Lookup  icon.

Page 132: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 132/449

 

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

Practices for Lesson 9

Chapter 8 - Page 22

c. In the Lookup Tables Wizard, select the SRC_CUSTOMER table in the Driving Table 

pane. In the Lookup Table pane, expand the HSQL_SRC model, and then selectSRC_AGE_GROUP. For alias, enter LKUP_AGE_RANGE, and then click Next.

d. In the screen that follows, select the AGE column in the Source table pane. SelectAGE_MIN in the Lookup pane, and then click the Join button.

Page 133: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 133/449

 

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

Practices for Lesson 9

Chapter 8 - Page 23

e. Edit the lookup condition to read:

SRC_CUSTOMER_AGE BETWEEN LKUP_AGE_RANGE.AGE_MIN. Select AGE_MAX inthe Lookup pane, and then click the Join button again.

Page 134: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 134/449

 

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

Practices for Lesson 9

Chapter 8 - Page 24

f. Edit the Lookup condition to read: SRC_CUSTOMER_AGE BETWEENLKUP_AGE_RANGE.AGE_MIN AND LKUP_AGE_RANGE.AGE_MAX. Click Finish.

Page 135: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 135/449

 

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

Practices for Lesson 9

Chapter 8 - Page 25

g. Click the button to arrange your datastores in the Source pane. In theConfirmation window, click Yes. Select AGE_RANGE in the target datastore, and click

the Expression Editor  icon .

Page 136: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 136/449

 

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

Practices for Lesson 9

Chapter 8 - Page 26

h. In the Expression Editor, select the AGE_RANGE column and drag it into theexpression window. Verify that your expression is LKUP_AGE_RANGE.AGE_RANGE.Click OK to close the Expression Editor.

Page 137: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 137/449

 

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

Practices for Lesson 9

Chapter 8 - Page 27

i. To verify the SQL expression, click the Check the expression in DBMS icon , andthen click OK. Click the Flow tab.

Page 138: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 138/449

 

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

Practices for Lesson 9

Chapter 8 - Page 28

 j. In the Flow  tab, click the Target area and ensure that IKM Selector is set to IKM OracleIncremental Update. Save the interface INT_9-2.

k. In the Designer Projects tab, select INT_9-2, and then click the icon to execute yourinterface. Select the Simulation check box, and then click OK.

l. In the Simulation window, scroll down to view the generated code for your lookup, andthen click Close.

Page 139: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 139/449

 

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

Practices for Lesson 9

Chapter 8 - Page 29

Page 140: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 140/449

 

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

Practices for Lesson 9

Chapter 8 - Page 30

2. Run interface INT_9-2 and view the lookup data.

a. Click the Execute button again to run your interface . Click OK. Click OK again.

Note: Do not  select the Simulation check box.

Page 141: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 141/449

 

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

Practices for Lesson 9

Chapter 8 - Page 31

b. Click the Operator  tab and verify that your interface INT_9-2 successfully executed.

c. Double-click (SRCSet1 - Load data), and then click the Code tab. View the code on thesource and on the target.

Page 142: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 142/449

 

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

Practices for Lesson 9

Chapter 8 - Page 32

d. Switch from the Operator Navigator to the Designer Navigator in the Projects tab, andopen the INT_9-2 interface if it is not still open. Click the interface’s Mapping tab.Right-click Target Datastore – TRG_CUSTOMER, and then select the Data option.View your lookup data. Close the Data Editor  window. Verify that your interface issaved and the close the tabs.

Page 143: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 143/449

 

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

Practices for Lesson 9

Chapter 8 - Page 33

Page 144: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 144/449

 

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

Practices for Lesson 9

Chapter 8 - Page 34

Page 145: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 145/449

 

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

Practices for Lesson 10

Chapter 9 - Page 1

Practices for Lesson 10

Chapter 9

Page 146: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 146/449

 

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

Practices for Lesson 10

Chapter 9 - Page 2

Practice 10-1: Creating ODI Interface: Exporting a Flat File to aRelational Table

Use Case Scenario:

In addition to the group of interfaces created earlier, John needs to create a project and aninterface to export data from a flat file and load this data into a relational table. He also needs toverify the quality of data loaded in the table.

Background:

In the previous practices, you learned how to create ODI Interfaces, which transform data fromone or more relational tables in the source to a relational table in the target.

In this practice, you create from scratch an ODI project and an interface to export data from aflat file to a relational table, execute and monitor the Interface with ODI, and check data quality.

Note: Completing this practice is critical for all the following practice sessions.

In this practice, you perform the following 10 steps, detailed here:

1. In Topology Navigator, define the FILE_GENERIC.C:\labs\Files\Flat_files physical schema.

2. In Topology Navigator, define the FLAT_FILES_SRC logical schema.

3. In Designer Navigator, create the Export-FF-RT project.

4. In Designer Navigator, create the Flat File1 source model.

a. Create the SRC_SALES_PERSON datastore.

b. Point to the resource: C:\labs\Files\Flat_files\SRC_SALES_PERSON.TXT.

c. Reverse-engineer and format the data (fixed length positions, data types).

5. In SQL Developer, create the RDBMS schema ODI_STAGE to host the ODI targetdatastore.

6. In SQL Developer, create the TRG_SALES_PERSON table to serve as the ODI datastore forthe target model.

7. In Topology Navigator, create the ODI target data server, ODI_STAGE; physical schema

ODI_STAGE; and logical schema ODI_STAGE.

8. In Designer Navigator, create the ODI target model, Oracle_RDBMS1.

9. Reverse-engineer the model and check the populated TRG_SALES_PERSON datastoretable.

10. Create a new ODI interface to perform the flat file to RDBMS table transformation.

 Your Tasks:

1. Create a new physical schema for the source flat-file model.

a. If not connected, connect to the Work repository, DEV_ODI_REPO. EnterSUPERVISOR in the User field and SUNOPSIS in the Password field. Click OK to log

in.

Page 147: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 147/449

 

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

Practices for Lesson 10

Chapter 9 - Page 3

b. Click Topology navigator. In Topology navigator, click the Physical Architecture tab,select Technologies > File. Right-click FILE_GENERIC, and then select New PhysicalSchema.

c. For the Directory (Schema) and Directory (Work Schema) fields, enter the path to thedirectory where your input flat files are located (C:\LABS\Files\Flat_files).Select the Default check box and click Yes in the Confirmation window, and then click

Page 148: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 148/449

 

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

Practices for Lesson 10

Chapter 9 - Page 4

the Save button. Close the editing window for your new physical schema. On theInformation window that follows, click OK. Close the editing tab.

d. Verify that your new Physical schema was added under the FILE_GENERIC dataserver in the Technologies tree view.

Page 149: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 149/449

 

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

Practices for Lesson 10

Chapter 9 - Page 5

e. Open Logical Architecture, navigate to Technologies > File, right-click File, and selectNew Logical Schema.

f. Enter the Logical Schema name: FLAT_FILES_SRC, and select the Physical schemaFILE_GENERIC in all three contexts as shown here. Click Save and close the editingwindow.

Page 150: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 150/449

 

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

Practices for Lesson 10

Chapter 9 - Page 6

g. Verify that your new Logical schema was added under the File node in theTechnologies tree view.

2. Create the new project in ODI.

a. Open the Designer tab and then click Projects. In the window that opens, click the New 

Project button and then select New Project to add a new project.

b. On the screen that appears, set the Name of the project to Export-FF-RT in the Name 

field. The Code field is filled in automatically. Click Save, and then close the tab. The

newly created Export-FF-RT project now appears in the Projects pane.

Page 151: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 151/449

 

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

Practices for Lesson 10

Chapter 9 - Page 7

3. Create a new model for the flat-file source datastore.

a. In ODI Designer, click the Models tab, and then click the New Model . Then selectthe New Model option to insert a new model.

b. On the screen that follows, enter the values provided in the following table. Click theReverse Engineer tab. Set the Context to Development. Click the Save icon.

Parameter Value

Name Flat_File_1

Technology File

Logical Schema FLAT_FILES_SRC

Page 152: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 152/449

 

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

Practices for Lesson 10

Chapter 9 - Page 8

4. Create a new ODI source datastore.

a. Right-click the newly created Flat_File1 model, and then select New Datastore.

Page 153: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 153/449

 

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

Practices for Lesson 10

Chapter 9 - Page 9

b. On the screen that appears, set the Name to SRC_SALES_PERSON. Click the button

next to the Resource Name field. Navigate to the C:\labs\Files\Flat_files folder,and then select the SRC_SALES_PERSON.txt file. Click Open.

c. Click the Files tab. Set the File Format to Fixed, and then click the Columns tab. 

Page 154: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 154/449

 

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

Practices for Lesson 10

Chapter 9 - Page 10

d. On the Columns tab, click the Reverse Engineer button. The following Confirmationscreen appears. Click Yes. The Column Setup Wizard appears. 

Page 155: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 155/449

 

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

Practices for Lesson 10

Chapter 9 - Page 11

e. Place the cursor, and then click the ruler at the beginning of each column as shownnext. The wizard marks each column as shown in the following screens.

Page 156: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 156/449

 

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

Practices for Lesson 10

Chapter 9 - Page 12

f. After the columns are marked, click each column data to select a column, and then setthe name and data type for each column in the Definition panel to the right, as shownin the following screens. For the names and data types of each column, refer to thistable. Click OK when you have finished.

Column Name Data type

C1 SALES_PERSON_ID numeric

C2 FIRST_NAME string

C3 LAST_NAME string

C4 DATE_HIRED string

Page 157: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 157/449

 

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

Practices for Lesson 10

Chapter 9 - Page 13

g. The columns should look as follows. Click Save to save the model. If the UnlockingObject window appears, select the check box and click OK. Expand Flat_File_1 >SRC_SALES_PERSON > Columns and view the newly created columns. 

Page 158: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 158/449

 

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

Practices for Lesson 10

Chapter 9 - Page 14

h. In the Flat_File_1 model, right-click the SRC_SALES_PERSON datastore, and thenselect the View Data option. Close all tabs as shown next. 

Page 159: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 159/449

 

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

Practices for Lesson 10

Chapter 9 - Page 15

5. You must create a schema to host the ODI target datastore. To create a new RDBMSschema for the ODI datastore, perform the following steps:

a. Open the Oracle SQL Developer window .You will create the schema by executing thefollowing SQL commands:

create user <MY_SCHEMA> identified by <MY_PASS> 

default tablespace <MY_TBS> temporary tablespace <MY_TEMP>; 

Note: If not started, you need to start SQL Developer and open the Administratorconnection (User Name: “system”, Password: “oracle1”). Refer to Practice 2-1. 

In this command:

Page 160: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 160/449

 

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

Practices for Lesson 10

Chapter 9 - Page 16

•  <MY_SCHEMA> corresponds to the name of the schema you want to create:ODI_STAGE

•  <MY_PASS> corresponds to the password that you gave: ODI_STAGE 

•  <MY_TBS> corresponds to the Oracle tablespace where the data will be stored:USERS

•  <MY_TEMP> corresponds to the temporary default tablespace: TEMP

To create a user, enter the following command. Verify that user ODI_STAGE is createdsuccessfully.Note: These commands also are provided in the text file 10-1.txt, which is locatedin the C:\LABS\Text folder.

create user ODI_STAGE identified by ODI_STAGE

default tablespace users temporary tablespace temp; 

b. Grant connect privileges to the newly created user by executing the following SQLcommand:

grant connect, resource, create trigger, create view toODI_STAGE; 

6. Now you need to create a new ODI datastore for the target model. This datastore will beused within the ODI Interface. To create a new ODI target datastore, perform the followingsteps: 

a. In SQL Developer create a new connection called ODI_STAGE. Enter the usernameas ODI_STAGE with the password ODI_STAGE. For SID enter ORCL. Click Test toverify the connection. Click the Save button and then click Connect.

Page 161: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 161/449

 

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

Practices for Lesson 10

Chapter 9 - Page 17

b. Create your target table by executing the following SQL commands. Expand theconnection, ODI_STAGE > Tables > TRG_SALES_PERSON, and verify that the tableis created successfully.

CREATE table "TRG_SALES_PERSON"(

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

"FIRST_NAME" VARCHAR2(80),

"LAST_NAME" VARCHAR2(80), 

"DATE_HIRED" VARCHAR2(80),

"DATE_UPDATED" DATE NOT NULL,

constraint "TRG_SALES_PERSON_PK" primary key("SALES_PERSON_ID")

Page 162: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 162/449

 

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

Practices for Lesson 10

Chapter 9 - Page 18

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

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

b. In the Data Server: New window, enter the values provided in the following table. Clickthe JDBC tab.

Parameter Value

Name ODI_STAGE 

Instance/dblink (Data Server) ORCL 

User ODI_STAGE 

Password ODI_STAGE 

Page 163: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 163/449

 

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

Practices for Lesson 10

Chapter 9 - Page 19

c. Click for JDBC Driver. Select Oracle JDBC Driver . Click OK. Click for JDBCUrl, select jdbc:oracle:thin:@<host>:<port>:<sid>, and then click OK. Edit the Url toread: jdbc:oracle:thin:@localhost:1521:ORCL for Oracle Database.Note: Do not copy and paste in the JDBC Url field. This action may cause problemswith entering a valid URL string.

Page 164: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 164/449

 

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

Practices for Lesson 10

Chapter 9 - Page 20

d. Click Test Connection. In the window that opens, click Yes to save your data. In theInformation window, click OK. Click Test to verify a successful connection. Click OK.

e. Expand Oracle technology node, right-click ODI_STAGE data server, and then selectNew Physical Schema.

Page 165: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 165/449

 

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

Practices for Lesson 10

Chapter 9 - Page 21

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

Page 166: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 166/449

 

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

Practices for Lesson 10

Chapter 9 - Page 22

g. Open the Logical Architecture tab, expand Technologies > Oracle. Right-click Oracletechnology and then select New Logical Schema.

h. Name logical schema ODI_STAGE. In all three contexts, connect this logical schemato the ODI_STAGE physical schema as shown here. Click the Save button and thenclose the tabs.

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

a. Open ODI Designer. Click the Models tab and select New Model. On the screen thatappears, enter the values provided in the following table. Click the Reverse Engineertab.

Parameter Value

Name Oracle_RDBMS1 

Page 167: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 167/449

 

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

Practices for Lesson 10

Chapter 9 - Page 23

Technology Oracle 

Logical Schema ODI_STAGE 

b. On the Reverse Engineer tab, set the Context to Development. Click the Save buttonand then close the Oracle_RDBMS1 tab. 

c. In the Models tab, right-click the Oracle_RDBMS1 model. Select Reverse Engineer. Toverify that the TRG_SALES_PERSON datastore is successfully reversed, expand themodel as shown here.

Page 168: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 168/449

 

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

Practices for Lesson 10

Chapter 9 - Page 24

9. Create a new ODI Interface to perform a flat-file-to-RDBMS-table transformation.

a. In ODI Designer, click the Projects tab. Expand your project, Export-FF-RT, and thenexpand First Folder. Right-click Interfaces and select New Interface. In theOptimization Context field, select Development.

Page 169: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 169/449

 

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

Practices for Lesson 10

Chapter 9 - Page 25

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

c. Click the Models tab to drag the source and target to the diagram. Drag theSRC_SALES_PERSON.txt datastore from the Flat_File1 model into the Sourcescontainer. Drag the TRG_SALES_PERSON datastore from the Oracle_RDBMS1model into the Target Datastore container. When Designer asks “Do you want toperform an Automatic Mapping?” click Yes.

Page 170: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 170/449

 

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

Practices for Lesson 10

Chapter 9 - Page 26

Page 171: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 171/449

 

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

Practices for Lesson 10

Chapter 9 - Page 27

d. Set the value for the DATE_UPDATED column in Target Datastore to System date. InTarget Datastore, select DATE_UPDATED. In the Implementation tab, enter SYSDATE.

Select Staging Area in the Execute on section. Ensure that the Active Mapping checkbox is selected. 

e. Select the FIRST NAME column in Target Datastore and edit the mapping to read:ltrim(SRC.FIRST_NAME). This function removes left spaces in the FIRST_NAMEcolumn. In the Execute on section, select Staging Area. Click OK. Repeat this step for

Page 172: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 172/449

 

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

Practices for Lesson 10

Chapter 9 - Page 28

columns LAST NAME and DATE HIRED. Refer to the mapping implementationprovided in the following table.

Column Mapping implementation

FIRST NAME Ltrim(SRC.FIRST_NAME)

LAST NAME Ltrim(SRC.LAST_NAME)

DATE HIRED Ltrim(SRC.DATE_HIRED)

Page 173: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 173/449

 

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

Practices for Lesson 10

Chapter 9 - Page 29

Page 174: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 174/449

 

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

Practices for Lesson 10

Chapter 9 - Page 30

f. For this interface, you export a flat file directly to a relational table target. The

knowledge modules required for this interface are LKM File to SQL and IKM SQLIncremental Update. To import the KMs, click the Project tab in the left panel andexpand the Knowledge Modules folder. Right-click Loading (LKM) and select ImportKnowledge Modules.

Page 175: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 175/449

 

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

Practices for Lesson 10

Chapter 9 - Page 31

g. In the File import directory field, you should have enteredC:\Oracle\Middleware\Oracle_ODI1\oracledi\xml-reference. Press andhold the Ctrl key, and then select IKM SQL Incremental Update and LKM File to SQL.Click OK. Close the Import Report window. View the imported KMs in the Projects treeview.

Page 176: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 176/449

 

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

Practices for Lesson 10

Chapter 9 - Page 32

Page 177: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 177/449

 

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

Practices for Lesson 10

Chapter 9 - Page 33

h. Click the Flow tab. Click the SrcSet_0 (FILE GENERIC) datastore. The properties forthe source appear in the following screen. For LKM, select LKM File to SQL from theLKM drop-down list if not selected. Now you need to ensure that the temporary objectscreated during the transformation are deleted. Set the LKM optionDELETE_TEMPORARY_OBJECTS to <Default>:true as shown here.

i. Click the Target datastore. Select IKM SQL Incremental Update. Set the IKM optionFlow_Control to False. Set the IKM option DELETE_ALL to True. Click Save.

Page 178: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 178/449

 

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

Practices for Lesson 10

Chapter 9 - Page 34

 j. To test your interface, click the Execute button . The following screen appears.

Retain the defaults and click OK. On the next screen, click OK.

Page 179: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 179/449

 

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

Practices for Lesson 10

Chapter 9 - Page 35

k. Open ODI Operator and verify that your interface was executed successfully. InOperator, click Session List tab, select All Executions, and the then click the refresh

button . View the execution results for the interface INT-EXP-FF-RT.

l. Double-click Step 12 and click the Execution tab. View the number of rows insertedinto the target table (16).

Page 180: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 180/449

 

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

Practices for Lesson 10

Chapter 9 - Page 36

10. Use the Quick Edit feature to enable filtering rows with Sales_Person_ID > 30. In addition,

you capitalize the first letter of each last name and first name, leaving the other charactersin lowercase.

a. In the INT-EXP-FF-RT tab, select Quick-Edit tab, expand Filters section, and then click Add Filters icon.

Page 181: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 181/449

 

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

Practices for Lesson 10

Chapter 9 - Page 37

b. Select SALES_PERSON_ID row, and then click Expression Editor icon . In the leftpanel of Expression Editor, double-click SALES_PERSON_ID. Edit the expression toread: SRC.SALES_PERSON_ID > 30. Click OK. For Execution Location, selectStaging. Click OK.

Page 182: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 182/449

 

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

Practices for Lesson 10

Chapter 9 - Page 38

c. Scroll down and expand the Mappings section. In Mappings, click theLtrim(First_name) column , and then select the Expression Editor icon. In functions,expand Strings, and then double-click the INITCAP function. Edit the expression toread: INITCAP(Ltrim(SRC.FIRST_NAME)). Click OK. 

Page 183: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 183/449

 

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

Practices for Lesson 10

Chapter 9 - Page 39

d. Repeat the previous step for the column LAST_NAME. Your result is shown in the

following screen. Click the Mapping tab and save your interface . 

Page 184: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 184/449

 

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

Practices for Lesson 10

Chapter 9 - Page 40

11. Execute your modified interface and verify the result.

a. In Designer execute your interface . Click OK. Click OK again

b. Open ODI Operator and verify that the interface executed successfully. Open step 8 –Integration. Click the Code tab, and view your modifications.

Page 185: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 185/449

 

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

Practices for Lesson 10

Chapter 9 - Page 41

Page 186: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 186/449

 

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

Practices for Lesson 10

Chapter 9 - Page 42

c. Click the INT_EXP_FF_RT tab. In the Mapping tab, right-click the target datastore andselect Data. View the filtered rows (SALES_PERSON_ID > 30) inserted in the table.Close your Data Editor and the tabs.

Page 187: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 187/449

 

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

Practices for Lesson 10

Chapter 9 - Page 43

Page 188: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 188/449

 

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

Practices for Lesson 10

Chapter 9 - Page 44

Page 189: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 189/449

 

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

Practices for Lesson 11

Chapter 10 - Page 1

Practices for Lesson 11

Chapter 10

Page 190: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 190/449

 

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

Practices for Lesson 11

Chapter 10 - Page 2

Practice 11-1: Using Native Sequences with ODI Interface

Use Case Scenario:

John created interfaces to load data in the target model from different sources and performeddata transformation, filtering, and implemented lookups. Now John needs to create an interfacethat would load data in the table by using Oracle native sequence, which generates ID numbersfor the target table.

Background:

In this practice, you first use ODI to define the procedure Create_ORCL_SEQ_FAM_ID. Youthen execute this procedure, which creates the sequence SEQ_FAMILY_ID in the RDBMS.

Next, you use ODI to create an ODI definition of the native sequence you just created in theRDBMS, using the same name, SEQ_FAMILY_ID.

Finally, you create and execute the interface INT-11-1 to load the TRG_PROD_FAMILY targettable by using the new native sequence to generate ID numbers for that table.

Note: Completing this practice is critical for all the following practice sessions.

 Your Tasks:

1. Create and execute an ODI procedure that creates an Oracle native sequence.

a. If not connected, connect to the DEV_ODI_REPO work repository (User:

SUPERVISOR, Password: SUNOPSIS). Click the Designer tab.

b. In the Projects tab, expand: HandsOnLoads > HandsOn. Right-click Procedures and

select New Procedure. Name the new procedure: Create_ORCL_SEQ_FAM_ID. Setthe Target technology to Oracle, as shown next. Click the Details tab.

Page 191: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 191/449

 

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

Practices for Lesson 11

Chapter 10 - Page 3

c. In the Details tab, select the Add command button . In the Name field, enter:Create ORCL SEQ. In the Command on target  tab, set the Technology field to

Oracle. In the Schema drop-down list, select ORACLE_ORCL_LOCAL_SALES. Inthe Command panel, enter the command, which creates the following sequence. Click

the Save icon to save the procedure. Close the tab. .

Note: This command is provided in the text file 11-1.txt in the following location:

c:\LABS\Text.

Page 192: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 192/449

 

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

Practices for Lesson 11

Chapter 10 - Page 4

d. Run the procedure Create_ORCL_SEQ_FAM_ID and verify the result of the executionin Operator.

Page 193: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 193/449

 

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

Practices for Lesson 11

Chapter 10 - Page 5

e. Open SQL Developer and expand: Administrator > Other Users > SALES_DEV >Sequences. Verify that your sequence SEQ_FAMILY_ID was created in RDBMS.

2. Create a new Native Sequence in ODI.

a. Open Designer. Click the Projects tab and expand: HandsOnLoads > HandsOn . Right-click Sequences, and then select New Sequence.

Page 194: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 194/449

 

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

Practices for Lesson 11

Chapter 10 - Page 6

b. Name the new sequence SEQ_FAMILY_ID. Select the Native Sequence check box. Inthe schema filed, select ORACLE_ORCL_LOCAL_SALES. Click the icon. In thewindow that follows, select the DEVELOPMENT context, and then select the nativesequence SEQ_FAMILY_ID. Click OK. Your screen should look as shown next. Savethe sequence, and then close the tab.

Page 195: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 195/449

 

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

Practices for Lesson 11

Chapter 10 - Page 7

3. Create a new interface to load the Product Family table by using the Native Sequence.

a. Right-click Interfaces, and select New Interface. Enter the new interface name:INT_11-1. In the Optimization Context field, select Development. Click the Mapping

tab.

Page 196: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 196/449

 

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

Practices for Lesson 11

Chapter 10 - Page 8

b. In the Models tab, expand the HSQL_SRC model and Oracle Sales Application model.Drag the SRC_PRODUCT datastore from the HSQL_SRC model to the source area inyour interface. Drag the TRG_PROD_FAMILY datastore from the Oracle Sales

 Application model to the target area. Click Yes to perform automatic mapping.

c. In the Target Datastore area, select FAMILY_ID, and then click the Expression Editor

icon . Expand the Project Sequences node, and then drag the sequenceSEQ_FAMILY_ID to the “expression” area. Click OK. Click the Flow tab.

Page 197: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 197/449

 

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

Practices for Lesson 11

Chapter 10 - Page 9

Page 198: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 198/449

 

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

Practices for Lesson 11

Chapter 10 - Page 10

d. In the Flow tab, click Target datastore, and then set IKM Selector to IKM SQL Control Append. In the Options, set FLOW_CONTOL to false, and set DELETE_ALL to true.Select the Distinct Rows check box. Save your interface. When the Fix Issue Dialogwindow appears, select Fix. This option enables not checking the FAMILY_ID column

for not null.

Page 199: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 199/449

 

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

Practices for Lesson 11

Chapter 10 - Page 11

Page 200: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 200/449

 

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

Practices for Lesson 11

Chapter 10 - Page 12

4. Execute the newly created interface and verify the data in the target table.

a. Execute Interface INT_11-1 as shown next, and then verify execution in the Operatortab.

Page 201: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 201/449

 

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

Practices for Lesson 11

Chapter 10 - Page 13

b. In the INT_11-1 tab, select the Mapping tab, right-click the Target DatastoreTRG_PROD_FAMILY, and then select Data. Verify the data inserted in the table. Closethe Data Editor window and INT_11-1 tab.

Page 202: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 202/449

 

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

Practices for Lesson 11

Chapter 10 - Page 14

Page 203: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 203/449

 

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

Practices for Lesson 11

Chapter 10 - Page 15

Practice 11-2: Using Temporary Indexes

Use Case Scenario:

John created interfaces to load data in the target model from different sources and performeddata transformation. He also created an interface, which loads data in the table by using Oraclenative sequence, which generates ID numbers for the target table.

Now John needs to load the target product table by using the source product table and the

lookup against the table, which contains the ID numbers generated by the newly createdinterface with the native sequence. John also needs to create a temporary index on the sourcetables to implement the join on the source.

Background:

In the previous practice, TRG_PROD_FAMILY was a target table. In this practice,TRG_PROD_FAMILY serves as one of the source tables.

First you create a new ODI interface, INT-11-2 to load data into the TRG_PRODUCT targetdatastore table in the Oracle Sales Application model. You specify the source tables asSRC_PRODUCT from the HSQL_SRC model, and TRG_PROD_FAMILY from the Oracle Sales

 Application model.

TRG_PROD_FAMILY will be used as a lookup table to obtain the ID number generated by the

previous lesson’s interface that used a sequence to populate the ID number.

For the lookup, you create a temporary index to join SRC_PRODUCT and TRG_PROD_FAMILY ontheir FAMILY_NAME column.

Finally, you execute the interface, view the source code, and examine the inserted rows in theTRG_PRODUCT target datastore.

Note: Completing this practice is critical for all the following practice sessions.

 Your Tasks:

1. Create a new ODI Interface with a temporary index on the source tables.

a. Expand the project HandsOnLoads > HandsOn > Interfaces. Right-click Interfaces andselect New Interface. Name this interface INT_11-2. Click the Mapping tab.

Page 204: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 204/449

 

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

Practices for Lesson 11

Chapter 10 - Page 16

b. In the Models tab expand the Oracle Sales Application and HSQL_SRC models. Dragthe TRG_PRODUCT datastore from the Oracle Sales Application model to the targetarea. Drag the TRG_PROD_FAMILY datastore from the Oracle Sales Application tothe Source mapping area. Click Yes to perform automatic mapping. Drag theSRC_PRODUCT datastore from the HSQL_SRC model to the source mapping area,as shown next. Click Yes to perform automatic mapping

c. Create a join between the two source tables by dragging FAMILY_NAME in theTRG_PROD_FAMILY datastore to FAMILY_NAME in the SRC_PRODUCT datastore,as shown in the following screen.

Page 205: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 205/449

 

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

Practices for Lesson 11

Chapter 10 - Page 17

d. Click the Join and scroll down to view the Join Property inspector. In the TemporaryIndexes section, set the index on SRC_PRODUCT(SRC_PRODUCT) to “Non-Unique.”Click the Flow tab.

Page 206: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 206/449

 

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

Practices for Lesson 11

Chapter 10 - Page 18

e. Click the Flow tab. In the flow tab, click the target datastore. Verify that the

DELETE_ALL parameter is set to “false.” Save your interface.

Page 207: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 207/449

 

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

Practices for Lesson 11

Chapter 10 - Page 19

2. Execute the Interface and verify the results.

a. In the Projects tab, execute your interface INT_11-2 as shown in the following screen.Click OK. Click OK again.

Page 208: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 208/449

 

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

Practices for Lesson 11

Chapter 10 - Page 20

b. Open ODI Operator, and verify that your interface executed successfully. Expand thesession to view steps as shown in the following screen.

Page 209: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 209/449

 

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

Practices for Lesson 11

Chapter 10 - Page 21

c. Double-click the step Integration – INT_11-2 – Create Temp. Indexes on Work. In theSession Task, select the Code tab. View the source code.

d. Scroll down, and then double-click the step Integration – INT_11-2 – Insert new rows,as shown in the screen. View the number of inserted rows.

Page 210: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 210/449

 

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

Practices for Lesson 11

Chapter 10 - Page 22

Page 211: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 211/449

 

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

Practices for Lesson 11

Chapter 10 - Page 23

e. Open the Designer tab. In the Interface INT_11-2 tab, select the Mapping tab. Right-click the target datastore, and then select Data to view inserted rows. Close DataEditor window and the tabs.

Page 212: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 212/449

 

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

Practices for Lesson 11

Chapter 10 - Page 24

Practice 11-3: Using Data Sets with ODI Interface

Use Case Scenario:

John created an interface to load data in the target model from different sources and performdata transformation and filtering, and provided a date when data was updated. He alsoimplemented a lookup to fetch additional information for the data loading in the target. Now Johncreates an interface with multiple data sets to add in a bulk feed of customer data from another

system.Background:

In this practice, you add a new data set to an interface. Building upon the interface INT_9-2 

you created in Lesson 9, you will add a bulk feed of customer data from another system byadding another data set.

First, you make a copy of interface INT_9-2, naming the copy as INT_11-3. This copy

includes the default  data set you defined in INT_9-2.

Now you create a new data set, naming it BULK_CUST_DATA . For its source, you specify the

TRG_BULK_CUSTOMER datastore from the Oracle Sales Application model.

You specify the UNION operator to unite this new source of data with the default data set that

you specified in INT_9-2.

Next, you perform an execution simulation to preview the code that will be used for this newdata set with the UNION operator.

Finally, you execute the interface and verify the rows inserted into the target table.

.

Note: Completing this practice is critical for all the following practice sessions.

 Your Tasks:

1. Create an ODI interface with multiple data sets.

a. In the Designer, right-click interface INT_9-2 and then duplicate it. Open the duplicateinterface and rename it INT_11-3.Open the Mapping tab.

Page 213: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 213/449

 

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

Practices for Lesson 11

Chapter 10 - Page 25

b. To arrange tables, click the Perform Layout icon , and then click Yes. Click the

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

Page 214: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 214/449

 

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

Practices for Lesson 11

Chapter 10 - Page 26

c. Enter the new data set name: BULK_CUST_DATA. Select Operator: UNION. Close theDataSets Configuration window.

d. In the Mapping tab, select the BULK_CUST_DATA data set tab. In the Models tab,drag the TRG_BULK_CUSTOMER datastore from the Oracle Sales Application to theSource area of the interface. Click Yes to perform automatic mapping.

Page 215: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 215/449

 

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

Practices for Lesson 11

Chapter 10 - Page 27

e. Open the Flow tab and verify the flow of your interface. Click the Target datastore.Ensure that the FLOW_CONTROL option is set to true and the DELETE_ALL option isset to true, as shown in the following.

Page 216: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 216/449

 

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

Practices for Lesson 11

Chapter 10 - Page 28

f. Open the Mapping tab again, select BULK_CUST_DATA tab, and then save interfaceINT_11-3.

Page 217: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 217/449

 

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

Practices for Lesson 11

Chapter 10 - Page 29

g. Perform an execution simulation in the Development context. In the Simulation window,

scroll down and view the simulated code for the data set TRG_BULK_CUSTOMERwith the UNION operator as shown next.

Page 218: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 218/449

 

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

Practices for Lesson 11

Chapter 10 - Page 30

Page 219: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 219/449

 

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

Practices for Lesson 11

Chapter 10 - Page 31

2. Execute interface INT_11-3 and verify the execution results.

a. Execute interface INT_11-3.

Page 220: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 220/449

 

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

Practices for Lesson 11

Chapter 10 - Page 32

b. Open the Operator. Verify that the session INT_11-3 executed successfully. Scrolldown and open the task Integration – INT_11-3- Insert new rows. Verify the numberof inserts in the target table.

Page 221: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 221/449

 

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

Practices for Lesson 11

Chapter 10 - Page 33

Page 222: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 222/449

 

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

Practices for Lesson 11

Chapter 10 - Page 34

Page 223: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 223/449

 

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

Practices for Lesson 12

Chapter 11 - Page 1

Practices for Lesson 12

Chapter 11

Page 224: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 224/449

 

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

Practices for Lesson 12

Chapter 11 - Page 2

Practice 12-1: Using Temporary ODI Interfaces

Use Case Scenario: 

John created interfaces to load data in the target models from different sources and performeddata transformation and filtering, and implemented a lookup to fetch additional information forthe data loading in the target. John also created an interface with multiple data sets to add in abulk feed of customer data from another system.

Now John needs to create a temporary interface, which is used for loading data to a sales targetdatastore.

Background:

In this practice, you perform the following steps:

1. Create a temporary interface, INT_12-1.

• 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 interface INT_12-1-2 

• Use the temporary interface INT_12-1 as a source.

• Use the datastore TRG_SALES as the target.

3. Execute INT_12-1-2 and examine the rows inserted into TRG_SALES.

 Your Tasks:

1. Develop an ODI Temporary interface.

Page 225: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 225/449

 

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

Practices for Lesson 12

Chapter 11 - Page 3

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

b. In the Projects tab, expand: HandsOnLoads > HandsOn. Right-click Interfaces, andthen select New Interface. Name the new interface INT_12-1. In the OptimizationContext field, select Development. For Staging Area, select Hypersonic SQL:HSQL_DEMO_SRC. Click the Mapping tab.

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

Page 226: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 226/449

 

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

Practices for Lesson 12

Chapter 11 - Page 4

d. Drag the ORDER_ID column from the datastore SRC_ORDERS to the datastoreSRC_ORDER_LINES to create a Join.

Page 227: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 227/449

 

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

Practices for Lesson 12

Chapter 11 - Page 5

e. Click the Lookup icon to start the Lookup Wizard . Ensure that your Driving table isSRC_ORDERS. Select the Lookup table, SRC_CUSTOMER, in the HSQL_SRCmodel. For the Lookup table, edit the Alias to read: LKUP_SRC_CUSTOMER asshown in the following screen. Click Next.

Page 228: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 228/449

 

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

Practices for Lesson 12

Chapter 11 - Page 6

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

Page 229: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 229/449

 

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

Practices for Lesson 12

Chapter 11 - Page 7

g. Now you need to create a temporary target datastore. Drag the column CUST_ID fromthe SRC_ORDERS table to the Target area. Click <Temporary Target DataStore>. Inthe Temporary Target Properties, enter Name: TEMP_AGG_ORDERS, as shown in

the following screen.

Page 230: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 230/449

 

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

Practices for Lesson 12

Chapter 11 - Page 8

h. Drag the column ORDER_ID from SRC_ORDERS to the Target area. Edit the mappingto read: MIN(SRC_ORDERS.ORDER_ID). Scroll down to the Target ColumnProperties section and rename this column to FIRST_ORDER_ID. Click the interfacetab and view the result.

Page 231: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 231/449

 

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

Practices for Lesson 12

Chapter 11 - Page 9

Page 232: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 232/449

 

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

Practices for Lesson 12

Chapter 11 - Page 10

i. Again, drag the column Order_ID from SRC_ORDERS to the Target  area. Edit themapping to read MAX(SRC_ORDERS.ORDER_ID). Scroll down and rename this columnLAST_ORDER_ID.

Page 233: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 233/449

 

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

Practices for Lesson 12

Chapter 11 - Page 11

 j. Drag the column ORDER_DATE from SRC_ORDERS to the Target  area. Edit themapping to read MIN(SRC_ORDERS. ORDER_DATE). Scroll down and rename thiscolumn FIRST_ORDER_DATE.

Page 234: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 234/449

 

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

Practices for Lesson 12

Chapter 11 - Page 12

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

Page 235: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 235/449

 

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

Practices for Lesson 12

Chapter 11 - Page 13

l. In the Source area, expand the lookup datastore. Drag the FIRST_NAME column fromthe 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 leftpanel of the Expression Editor to the “expression" area.

Page 236: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 236/449

 

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

Practices for Lesson 12

Chapter 11 - Page 14

Page 237: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 237/449

 

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

Practices for Lesson 12

Chapter 11 - Page 15

m. Edit the expression to read LK_UP_SRC_CUSTOMER.FIRST_NAME | | ‘ ‘ ||

LK_UP_SRC_CUSTOMER.LAST_NAME, as shown next. Click OK. Click the buttonto validate the expression.

Page 238: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 238/449

 

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

Practices for Lesson 12

Chapter 11 - Page 16

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

Page 239: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 239/449

 

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

Practices for Lesson 12

Chapter 11 - Page 17

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).

Page 240: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 240/449

 

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

Practices for Lesson 12

Chapter 11 - Page 18

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

Page 241: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 241/449

 

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

Practices for Lesson 12

Chapter 11 - Page 19

q. Drag again the column AMOUNT from the SRC_ORDER_LINES source datastore to

the Target  area. Edit the mapping expression to readSUM(SRC_ORDER_LINES.AMOUNT). Rename this column SUM_AMOUNT.

Page 242: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 242/449

 

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

Practices for Lesson 12

Chapter 11 - Page 20

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

the Target  area.

Page 243: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 243/449

 

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

Practices for Lesson 12

Chapter 11 - Page 21

s. In the Target datastore, click the SUM_AMOUNT column. In the Execute on section,select Staging Area. Repeat this step for all the other columns that have a function inmapping expression. Refer to the following table to verify the execution location. YourTarget datastore should now look as shown in the screen. Click the Flow tab.

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

Page 244: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 244/449

 

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

Practices for Lesson 12

Chapter 11 - Page 22

QTY Staging Area

t. Verify the flow, and then save your temporary interface. Verify that your temporaryinterface appeared in the tree view. Close your interface tab.

Note the color of your newly created temporary interface in the objects tree view.

Page 245: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 245/449

 

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

Practices for Lesson 12

Chapter 11 - Page 23

2. Create a new interface, which uses the newly created temporary interface as a source.

a. In the HandsOnLoads project, start creating a new ODI interface, INT_12-1-2, asshown next. In the Optimization Context  field, select Development. Open the Mapping tab.

Page 246: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 246/449

 

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

Practices for Lesson 12

Chapter 11 - Page 24

b. Drag the temporary interface, INT_12-1, from the Projects tab to the Source area.

c. Drag the datastore TRG_SALES from the Oracle Sales Application model  to theTarget Datastore area. Click Yes to perform automatic mapping.

Page 247: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 247/449

 

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

Practices for Lesson 12

Chapter 11 - Page 25

d. In the Target Datastore, select the FIRST_ORD_DATE column. Drag theFIRST_ORDER_DATE column from the temporary interface in the source area to the

Implementation tab in the Mapping Properties area.

Page 248: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 248/449

 

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

Practices for Lesson 12

Chapter 11 - Page 26

e. Repeat the previous step to map columns FIRST_ORDER_ID, LAST_ORDER_ID, and

LAST_ORDER_DATE to the corresponding columns in the temporary interface in theSource area. Map AMOUNT to SUM_AMOUNT, PROD_AVG_PRICE to theAVG_AMOUNT column in the temporary interface, as shown below.

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

Page 249: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 249/449

 

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

Practices for Lesson 12

Chapter 11 - Page 27

g. To view data derived from the temporary interface, right-click the temporary interfaceand select Data. Close the Data Editor  window.

Page 250: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 250/449

 

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

Practices for Lesson 12

Chapter 11 - Page 28

h. Select the Flow tab, click Target datastore, and verify the flow of your interface. In theTarget Properties, set the DELETE_ALL option to true. Save the interface, and thenclose the interface tab.

Page 251: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 251/449

 

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

Practices for Lesson 12

Chapter 11 - Page 29

3. Execute the interface INT_12-1-2 and verify the execution results.

a. Execute the interface INT_12-1-2.

Page 252: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 252/449

 

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

Practices for Lesson 12

Chapter 11 - Page 30

b. Open ODI Operator Navigator and verify that the interface INT_12-1-2 executedsuccessfully. Scroll down and open the task Integration - INT_12-1-2 - Insert newrows. Verify the number of inserts.

Page 253: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 253/449

 

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

Practices for Lesson 12

Chapter 11 - Page 31

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.

Page 254: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 254/449

 

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

Practices for Lesson 12

Chapter 11 - Page 32

Page 255: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 255/449

 

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

Practices for Lesson 12

Chapter 11 - Page 33

Practice 12-2: Developing a New Knowledge Module

Use Case Scenario: 

To develop the integration project, John created the ODI project and the interface to export datafrom a flat file and load this data into a relational table. Now he decides to modify the existingKM to create an audit table each time the interface runs.

Background:

 After the interface is created and tested, you may need to create a new knowledge module touse with the interface.

In this practice, you duplicate an existing knowledge module, IKM SQL Incremental Update,naming the new knowledge module IKM Oracle UI - Audit. You add two commands to theknowledge module, “Create Audit Table” and “Insert Audit Records,” using command syntaxprovided in text files.

Next, you duplicate an existing interface, INT-Exp-FF-RT, naming the new interface INT-EXP-FF-RT. You change the new interface’s IKM selection to use the new knowledge module you

 just created, IKM Oracle UI - Audit.

Finally, you execute interface INT-EXP-FF-RT and examine the audit records inserted into theaudit table created by your knowledge module.

Duplicate the knowledge module, IKM SQL Incremental Update, naming the new KM IKMOracle UI – Audit. You insert into the KM two new commands: “Create Audit Table”and “Insert Audit Records.”

Duplicate the interface INT-EXP-FF-RT, naming the new interface INT-EXP-FF-RT-Audit.You change the interface’s IKM entry to use your new KM: IKM Oracle UI – Audit.

 Your Tasks:

1. Create the new knowledge module with new functionality to create an audit table and insertaudit records.

Page 256: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 256/449

 

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

Practices for Lesson 12

Chapter 11 - Page 34

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

b. Open ODI Designer and click the Projects tab. Select Projects > Export-FF-RT >Knowledge Modules > Integration (IKM). Right-click IKM SQL Incremental Update andselect Duplicate Selection. In the window that follows, click Yes.

Page 257: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 257/449

 

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

Practices for Lesson 12

Chapter 11 - Page 35

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

Note: If the message for Object Locking/Unlocking is displayed, click OK.

d. Click the Details tab. 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.

Page 258: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 258/449

 

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

Practices for Lesson 12

Chapter 11 - Page 36

e. In the Command New  window, name this command Create Audit Table. Selectthe Ignore Errors check box. Set the Technology on Target to Oracle. Enter thefollowing command to create the audit table. Verify that the check boxes in theJournalizing  section are not selected. If necessary, deselect them.

Note: You can find this command in the file 12-2.txt, provided in the followinglocation: c:\Labs\Text.

Page 259: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 259/449

 

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

Practices for Lesson 12

Chapter 11 - Page 37

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)

f. Click the Details tab. Scroll down and select the Create Audit Table command.

Click the icon several times to move the command up and place it right after theInsert new rows step, as shown below. Select the Ignore Errors check box, as shown

in the following below. Click the Add icon again .

Page 260: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 260/449

 

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

Practices for Lesson 12

Chapter 11 - Page 38

Similarly, create the command that inserts audit records in the audit table, as shown inthe screen. Name this command Insert Audit Records. Select the Ignore Errors check box. Set the Technology on Target to Oracle. Enter the command provided

below.Note: You can find this command in the file 12-2.txt, provided in the followinglocation: c:\Labs\Text.

Page 261: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 261/449

 

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

Practices for Lesson 12

Chapter 11 - Page 39

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: 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”]).

getColList:

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

Page 262: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 262/449

 

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

Practices for Lesson 12

Chapter 11 - Page 40

`

 

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

Click the icon several times to move the command up and place it right after theCreate Audit Table step, as shown in the next screen. Click Save, and then closethe tab.

Page 263: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 263/449

 

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

Practices for Lesson 12

Chapter 11 - Page 41

h. Verify that your new knowledge module, IKM Oracle UI – Audit, appeared in theKnowledge Modules tree.

2. Modify the interface INT-EXP-FF-RT to be executed with your newly created knowledgemodule. You will need to duplicate the existing interface, rename it, and then change theIKM entry to use IKM Oracle UI-Audit.

Page 264: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 264/449

 

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

Practices for Lesson 12

Chapter 11 - Page 42

a. On the Projects tab, right-click the interface INT-EXP-FF-RT and select Duplicate. ClickYes on the Confirmation screen.

b. Double-click the interface Copy of INT-Exp-FF-RT. Change the name of the interfaceto INT-Exp-FF-RT-Audit, as shown in the screen. Click the Flow tab.

Page 265: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 265/449

 

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

Practices for Lesson 12

Chapter 11 - Page 43

c. On the Flow tab, click Target (ODI_STAGE)-Target + Staging Area to open the IKMSelection section. Select IKM Oracle UI – Audit. Ensure that in the IKM Selectionsection, FLOW_CONTROL and STATIC_CONTROL options are set to false, as shown

in the screen. Click the Save button, and then close the tab.

Page 266: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 266/449

 

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

Practices for Lesson 12

Chapter 11 - Page 44

To execute your new interface, select the interface and click the Execute button .Click OK. Click Yes to save your interface. Click OK again to start the execution.

Page 267: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 267/449

 

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

Practices for Lesson 12

Chapter 11 - Page 45

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 thesession steps.

e. Scroll down and double-click the Create Audit Table step. View the content of theDefinition and Code tabs for this step. Close the tab.

Page 268: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 268/449

 

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

Practices for Lesson 12

Chapter 11 - Page 46

f. Similarly, view the Insert Audit Records step information. Refer to the followingscreens. Click Cancel.

Page 269: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 269/449

 

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

Practices for Lesson 12

Chapter 11 - Page 47

Page 270: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 270/449

 

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

Practices for Lesson 12

Chapter 11 - Page 48

g. Open the Oracle SQL developer and expand the ODI_STAGE connection (for thepassword, enter ODI_STAGE). Select Tables node and if necessary click the Refresh

button . Double–click the Audit table TRG_SALES_H, click Data tab, and verifythat your Audit table was created and populated with audit records, as shown next.

3. In addition, you create an option for your new knowledge module to make your KM moreuser-friendly. This option will enable an end user to choose when to generate audits.

a. In Designer, click the Projects tab, right-click IKM Oracle UI – Audit, and select NewOption. Name this option AUDIT_CHANGES, set Type to Check Box, and DefaultValue to true. Click Save and close the AUDIT_CHANGES option tab.

Page 271: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 271/449

 

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

Practices for Lesson 12

Chapter 11 - Page 49

b. Now you need to link this option to your steps in KM. Double-click IKM Oracle UI - Audit, and click the Details tab. Double-click your new step, Create Audit Table, to editit, and then scroll down and click the Options.

Page 272: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 272/449

 

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

Practices for Lesson 12

Chapter 11 - Page 50

c. Deselect the Always Execute check box. Select AUDIT_CHANGES. This will conditionthe execution of these steps with the value set by the end user. Click Save. Click theDetails tab.

Page 273: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 273/449

 

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

Practices for Lesson 12

Chapter 11 - Page 51

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

Page 274: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 274/449

 

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

Practices for Lesson 12

Chapter 11 - Page 52

e. Double-click INT-Exp-FF-RT-Audit to edit it. Click the Flow tab, click Target(ODI_STAGE), and verify that the option AUDIT_CHANGES is set to true.

Execute the interface .

Page 275: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 275/449

 

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

Practices for Lesson 12

Chapter 11 - Page 53

f. If not opened, open ODI Operator, select All Executions, and then click the Refreshbutton and view the execution results. Both Create Audit Table and Insert Audit

Records steps should be present.

Page 276: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 276/449

 

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

Practices for Lesson 12

Chapter 11 - Page 54

g. In Designer, edit the interface to set the option AUDIT_CHANGES to false. Save your

interface and then execute your interface again .

Page 277: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 277/449

 

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

Practices for Lesson 12

Chapter 11 - Page 55

Page 278: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 278/449

 

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

Practices for Lesson 12

Chapter 11 - Page 56

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

Page 279: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 279/449

 

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

Practices for Lesson 12

Chapter 11 - Page 57

Page 280: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 280/449

 

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

Practices for Lesson 12

Chapter 11 - Page 58

Page 281: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 281/449

 

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

Practices for Lesson 13

Chapter 12 - Page 1

Practices for Lesson 13

Chapter 12

Page 282: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 282/449

 

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

Practices for Lesson 13

Chapter 12 - Page 2

Practice 13-1: Creating an ODI Procedure

Use Case Scenario: 

John created the new ODI project and an interface to perform the transformations described inthe previous practices. Now he needs to modify his project by adding an ODI procedure tocreate a relational table and populate it with data.

Background:

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

In this practice, you use the same RDBMS schema, ODI dataserver, and ODI physical schema–all named ODI_STAGE –which you created in Practice 10-1. In the predefined project,Procedure-CRT-TBL, you create the procedure PRD-create-populate-table.

Next, you add commands to drop, create, and populate a table, using the syntax provided in textfiles.

Finally, you execute the procedure and verify that the table was created and populated withrecords.

1. Create the project Procedure-CRT-TBL.

2. Create the procedure PRD-create-populate-table.

3. Add commands to drop, create, and populate a table.

 Your Tasks:

1. Create new project in ODI Designer.

Page 283: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 283/449

 

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

Practices for Lesson 13

Chapter 12 - Page 3

a. Switch to the Designer Navigator. Click the Designer tab. Select the Projects tab, click

the New Project icon, and select New Project.

b. Enter the name of the project: Procedure-CRT-TBL. Click the Save button to create theproject and close the tab. The project appears in the tree view. Expand the Procedure-CRT-TBL project node.

Note: In this practice, you use the same RDBMS schema, ODI data server, and physicalschema that you created in Practice10-1. If you have not performed Practice 10-1,complete Practice 10-1, steps 5 and 7 to create the RDBMS schema, the ODI source dataserver, and the physical schema for your new RDBMS model.

c. Open the ODI Topology Navigator, select Physical Architecture. Expand Technologies> Oracle > ODI _STAGE. Verify that you have the physical schema ODI_STAGEcreated under ODI_STAGE data server.

Page 284: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 284/449

 

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

Practices for Lesson 13

Chapter 12 - Page 4

d. Open ODI Designer. In the Projects tab, select Procedure-CRT-TBL > First Folder.Right-click Procedures and select New Procedure.

e. Enter the procedure name as PRD-create-populate-table. Set Target Technology to

Oracle. Click the Details tab. Click the icon to add a step in the procedure.

Page 285: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 285/449

 

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

Practices for Lesson 13

Chapter 12 - Page 5

f. In the Command: New window, enter the parameters of the procedure and thecommand on the target provided in the following table. You need this command to dropthe table in case a table with this name exists. Select the Ignore Errors check box.

Parameter Value

Name Drop table 

Technology Oracle

Schema ODI_STAGE

Ignore Errors Checked

DROP table ODI_STAGE.SRC_SALES_PERSON

g. Select the Details tab, and then click the icon to add another step in theprocedure. In the Command: New screen, if not selected, click the Command onTarget tab. Enter the parameters of the procedure and the command provided below.

Note: You can copy this command from the 13-1.txt file, which is provided in yourLab folder in the following location: c:\Labs\Text.

Page 286: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 286/449

 

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

Practices for Lesson 13

Chapter 12 - Page 6

Parameter Value

Name Create Table 

Technology Oracle

Schema ODI_STAGE

Ignore Errors Unchecked

CREATE table "SRC_SALES_PERSON" (

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

"FIRST_NAME" VARCHAR2(80),

"LAST_NAME" VARCHAR2(80),

"DATE_HIRED" VARCHAR2(80),

"DATE_UPDATED" DATE NOT NULL,

constraint "SRC_SALES_PERSON_PK" primary key("SALES_PERSON_ID")

h. Click the Details tab. Click the icon to enter the step to populate theSRC_SALES_PERSON table.

i. In the Command: New  screen, click the Command on Target tab. Enter theparameters and the command shown below. Click the Details tab to view your steps.

Note: You can copy this command from the file 13-1.txt, which is provided at thefollowing location: c:\Labs\ Text.

Parameter Value

Name Populate table 

Technology Oracle

Page 287: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 287/449

 

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

Practices for Lesson 13

Chapter 12 - Page 7

Schema ODI_STAGE

Ignore Errors Unchecked

Page 288: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 288/449

 

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

Practices for Lesson 13

Chapter 12 - Page 8

begin

insert into ODI_STAGE.SRC_SALES_PERSON values

(11,'Andrew','Andersen','22/02/1999',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(12,'John','Galagers','20/04/2000',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values(13,'Jeffrey','Jeferson','32422',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(20,'Jennie','Daumesnil','28/02/1988',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(21,'Steve','Barrot','24/09/1992',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(22,'Mary','Carlin','14/03/1995',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(30,'Paul','Moore','36467',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values(31,'Paul','Edwood','18/03/2003',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(32,'Megan','Keegan','29/05/2001',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(40,'Rodolph','Bauman','29/05/2000',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(41,'Stanley','Fischer','37233',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(42,'Brian','Schmidt','25/08/1992',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values(50,'Anish','Ishimoto','30/01/1992',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(51,'Cynthia','Nagata','28/02/1994',sysdate);

insert into ODI_STAGE.SRC_SALES_PERSON values

(52,'William','Kudo','28/03/1993',sysdate);

end; 

Page 289: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 289/449

 

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

Practices for Lesson 13

Chapter 12 - Page 9

 j. Click Save and close the tab.

2. Execute your newly created procedure and verify the results.

a. Expand Procedure-CRT-TBL > Procedures, select the newly created procedure PRD-

create-populate-table, and then click the Execution button to run the procedure .Click OK. Click OK again.

Page 290: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 290/449

 

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

Practices for Lesson 13

Chapter 12 - Page 10

b. Open ODI Operator. In ODI Operator, click the All Executions node, click the Refresh

icon, find your session, and verify that your procedure executed successfully.

c. Open the Oracle SQL developer and expand the ODI_STAGE connection. SelectTables node and click the Refresh button . Double–click the newly created tableSRC_SALES_PERSON, click the Data tab, and verify that your tableSRC_SALES_PERSON was successfully created and populated with records asshown in the following screen.

3. Additionally, you create an option to delete rows from the target audit table, which youcreated in Practice 12-2. To delete rows, you add a command that uses the value of theoption in the code. If the value of this option is set to “Y”, the command to delete recordswill be executed.

a. Right-click your procedure and select New Option. Name this optionDELETE_AUDIT_RECORDS, and set Type to Value. Add the description as shown onthe screen. Set the default value of this option to Y (no quotes). Click the Save icon.

Page 291: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 291/449

 

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

Practices for Lesson 13

Chapter 12 - Page 11

b. Open your procedure, PRD-create-populate-table, and then click the Details tab. Clickthe Add icon to add a new command.

c. Add the new command on Target to delete records in the audit tableTRG_SALES_PERSON_H. Set the parameters as shown in the following table.

Note: You can copy this command from the file 13-1.txt, which is provided at thefollowing location: c:\Labs\Text.

Page 292: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 292/449

 

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

Practices for Lesson 13

Chapter 12 - Page 12

Parameter Value

Name DELETE AUDIT RECORDS 

Technology Oracle

Schema ODI_STAGE

Ignore Errors Checked

d. Click the Options tab and verify that the value of your newly created option is set to Y.Click the Save icon.

Note: To view the inputs in the Options tab, you must click the Refresh button.

e. Execute your procedure. In Operator, verify that the procedure executed successfully.

Page 293: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 293/449

 

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

Practices for Lesson 13

Chapter 12 - Page 13

f. Open SQL Developer and expand ODI_STAGE > Tables. Open the Audit tableTRG_SALES_PERSON_H, click the Data tab, and verify that the rows were deletedfrom the Audit table.

Page 294: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 294/449

 

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

Practices for Lesson 13

Chapter 12 - Page 14

Page 295: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 295/449

 

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

Practices for Lesson 14

Chapter 13 - Page 1

Practices for Lesson 14

Chapter 13

Page 296: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 296/449

 

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

Practices for Lesson 14

Chapter 13 - Page 2

Practice 14-1: Creating an ODI Package

Use Case Scenario: 

While working on his data integration projects, John created the ODI project and a number ofinterfaces for ELT processing. Now he decides to build a procedure for handling repetitiveoperations and a package to use this procedure and the interfaces.

Background:

 A common task that is performed by using ODI is to create a package that executes a numberof objects (Interfaces, Procedures) in the flow. In this practice, students create an ODIprocedure and package to execute the sequence of transformations with the interfaces createdin the previous practices.

In this practice, you create a procedure, DELETE_TARGET, for deleting from theTRG_CUSTOMER, TRG_CITY, TRG_REGION, and TRG_COUNTRY tables.

Then you create and execute a package, PKG_14-1. This package runs your new procedure,and then runs four interfaces you defined earlier in Lessons 8 and 9, which will use these sametables as targets:

• The DELETE_TARGET procedure

Practice 8-1 interface• Practice 8-2 interface

• Practice 8-3 interface

• Practice 9-1 interface

Finally, you run this package and review its execution in ODI Operator.

 Your Tasks:

1. Create a DELETE_TARGET procedure that deletes the data in the TRG_CUSTOMER, TRG_CITY, TRG_REGION, and TRG_COUNTRY tables in the ORACLE_LOCAL_SALES logicalschema.

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

Page 297: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 297/449

 

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

Practices for Lesson 14

Chapter 13 - Page 3

b. In the Designer tab, click the Projects tab, and then select the Procedures node fromthe HandsOnLoads > HandsOn folder. Right-click the Procedures node and select theNew Procedure option.

c. Enter DELETE_TARGET in the Name field, and select ORACLE as the Target

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

d. In the Name Field, enter DELETE TRG_SALES. In the Schema field, selectORACLE_ORCL_LOCAL_SALES. In the Context field, select Development.

In the Command field, enter the following code:

Page 298: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 298/449

 

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

Practices for Lesson 14

Chapter 13 - Page 4

DELETE FROM <?=odiRef.getObjectName("L", "TRG_SALES","ORACLE_ORCL_LOCAL_SALES", "", "D") ?>

This method returns the table name with run time–dependent information, such as theOracle schema name that may vary depending on the context and topology. Select theIgnore Errors check box. Select the Details tab.

e. Click the Add icon. In the Name Field, enter DELETE TRG_CUSTOMER. In theSchema field, select ORACLE_ORCL_LOCAL_SALES. In the Context field, selectDevelopment.

In the Command field, enter the following code:

DELETE FROM <?=odiRef.getObjectName("L", "TRG_CUSTOMER","ORACLE_ORCL_LOCAL_SALES", "", "D") ?>

This method returns the table name with run time–dependent information, such as theOracle schema name that may vary depending on the context and topology. Select the

Ignore Errors check box. Select the Details tab.

Page 299: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 299/449

 

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

Practices for Lesson 14

Chapter 13 - Page 5

f. Repeat the two previous steps to create the commands DELETE TRG_CITY, DELETETRG_REGION, and DELETE TRG_COUNTRY, which delete the tables TRG_CITY, TRG_REGION, and TRG_COUNTRY, respectively, as shown in the following screen.

Note: To enter the commands, you may refer to the file 14-1.txt provided at thefollowing location: c:\Labs\Text.

Page 300: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 300/449

 

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

Practices for Lesson 14

Chapter 13 - Page 6

g. Open the Details tab to view the commands. Click the Save button, and then close theprocedure tab.

Page 301: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 301/449

 

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

Practices for Lesson 14

Chapter 13 - Page 7

2. Create a package, PKG_14-1, that runs:

•  The DELETE_TARGET procedure

•  The INT_8-1 interface

•  The INT_8-2 interface

•  The INT_8-3 interface

•  The INT_9-1 interface

Note: These interfaces were created in Practice 8-1 and Practice 9-1.

a. Expand the Interfaces and Procedures nodes in the HandsOnLoads > HandsOn folder.Right-click the Packages node and select the New Package option.

b. Enter PKG_14-1 in the Name field, and then click the Diagram tab. In the tree view,

expand the Interfaces node and Procedures node. Select the DELETE_TARGETprocedure from the tree view, and then drag it to the diagram workbench. ADELETE_TARGET step appears in the package.

Page 302: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 302/449

 

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

Practices for Lesson 14

Chapter 13 - Page 8

c. Repeat the operation for the INT_8-1, INT_8-2, INT_8-3, and INT_9-1 interfaces. Thepackage should appear as follows.

d. Rename your steps with the names of the tables loaded by the step. In the Diagramwindow, click the step for the DELETE_TARGET procedure. Edit the Step name:DELETE TARGET TABLES, as shown in the following screen. In the diagram, click theempty space. The step is now renamed Delete Target Tables.

Page 303: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 303/449

 

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

Practices for Lesson 14

Chapter 13 - Page 9

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

f. Click the Step After Success tool icon on the Package toolbar. Click the DeleteTarget Tables step. Press and hold the left mouse button and move the cursor over theCountries step. Then, release the mouse button. A green arrow appears betweenthese steps.

Page 304: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 304/449

 

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

Practices for Lesson 14

Chapter 13 - Page 10

g. Click the Countries step. Press and hold the left mouse button and move the cursor

over the Regions step. Then, release the mouse button. A green arrow appearsbetween these steps. Repeat this operation to link the steps in the correct order:Countries > Cities > Regions > Customers, as follows.

h. Click the Save button to save this package and close the package tab.

3. Run this Package and review its execution in ODI Operator.

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

Page 305: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 305/449

 

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

Practices for Lesson 14

Chapter 13 - Page 11

b. In ODI Operator, click the Refresh icon. In the session list, expand the All Executionsnode. The session called PKG_14-1 should appear as complete. You can expand thenodes in the session to see the steps and tasks corresponding to your procedurecommands and the interfaces that have been executed.

c. Open the Designer tab and close the PKG_14-1 tab. Click Yes to unlock this package.

Page 306: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 306/449

 

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

Practices for Lesson 14

Chapter 13 - Page 12

Page 307: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 307/449

 

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

Practices for Lesson 14

Chapter 13 - Page 13

Practice 14-2: Using ODI Package with Variables and User Functions

Use Case Scenario: 

John needs to add more complexity to the workflow by creating a user function for mapping thevalues. This function will convert the values (0, 1, 2) to (“Mr,” “Mrs,” “Ms”). He also needs tocreate a variable DELETION_FLAG  for counting the number of lines in TRG_CUSTOMER and to

have the Delete Target step running only if DELETION_FLAG  is greater than 0.

Background:

 A common task that is performed by using ODI is using user functions and variables to addmore complexity to your workflows and mappings. This practice will explain how to usevariables, user functions, and the more advanced features in the packages.

1. In the HandsOnLoads project, define a user function group named Conversion,containing a user function named DearConvert.

2. Use this function in the interface INT_9-1 to convert the values (0, 1, 2) to (“Mr”, “Mrs”,“Ms”).

3. In ODI Designer, create a numeric variable DELETION_FLAG that counts the number oflines in TRG_CUSTOMER.

4. Duplicate the PKG_14-1 package, naming the new package PKG_14-2.5. Have the DELETE_TARGET procedure run only if the DELETION_FLAG variable is greater

than 0.

 Your Tasks: 

1. Create a user function called DearConvert in a new user function group called

Conversion. This function converts the values (0, 1, 2) to (“Mr,” “Mrs,” “Ms”). Implementthis function for Oracle as linked technology with a CASE WHEN expression.

Note: Remember to use the dollar sign ($) when using the parameters.

a. Select the User Functions node in the HandsOnLoads project. Right-click this nodeand select New User Function.

Page 308: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 308/449

 

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

Practices for Lesson 14

Chapter 13 - Page 14

b. Enter DearConvert in the Name field, enter Conversion in the Group field, and enterthe following in the Description field:

Converts the values (0, 1, 2) to (“Mr”, “Mrs”, “Ms”). In the Syntaxfield, enter: DearConvert($1)

Note: $1 is the parameter name you use in the decision case structure shown in thefollowing scren.

Click the Implementations tab, and then click the Add button.

Page 309: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 309/449

 

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

Practices for Lesson 14

Chapter 13 - Page 15

c. In the Implementation window, select Hypersonic SQL from the list of LinkedTechnologies. Verify that Oracle technology is also selected. Enter the following codein the Implementation syntax field. Click OK to save this implementation. Click theSave icon, and then close the DearConvert user function tab.

Note: In Locking/Unlocking Object windows that may appear, click Yes.Note: To enter the commands, you may refer to the file 14-2.txt provided at thefollowing location: c:\Labs\Text.

CASE WHEN $1 = '0' THEN 'Mr' WHEN $1 = '1' THEN 'Mrs'

WHEN $1 = '2' THEN 'Ms' ELSE NULL END 

Page 310: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 310/449

 

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

Practices for Lesson 14

Chapter 13 - Page 16

2. You use this function in the interface INT_9-1 to convert the source DEAR column into thetarget DEAR column.

a. In the Projects tree view expand Interfaces. Double-click the interface INT_9-1 to openit. In the Locking window, click Yes. Click the Mapping tab.

Page 311: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 311/449

 

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

Practices for Lesson 14

Chapter 13 - Page 17

b. In the Target datastore, select the Dear  column. Edit the implementation in theProperties panel to have the following code:

DearConvert(SRC_CUSTOMER.DEAR). Scroll down to select the Staging Area option from the Execute on panel. Click the Save button to save the interface.

3. Run the INT_9-1 interface and review the conversion result.

Page 312: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 312/449

 

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

Practices for Lesson 14

Chapter 13 - Page 18

a. In the interface window, click the Execute button. In the Execution window, selectDevelopment context, and then click OK. Click OK when the “Session started”message appears. Close the INT_9-1 editing tab.

b. Click the Operator tab. Select All Executions, and then click Refresh. Expand the AllExecutions node. The session called INT_9-1 should appear as complete.

Page 313: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 313/449

 

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

Practices for Lesson 14

Chapter 13 - Page 19

c. In the Mapping tab, right-click the Target datastore and select Data. Verify that thecolumn DEAR was populated with “Mr” as shown below.

Page 314: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 314/449

 

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

Practices for Lesson 14

Chapter 13 - Page 20

4. Create a numeric variable called DELETION_FLAG that counts the number of lines inTRG_CUSTOMER.

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

Page 315: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 315/449

 

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

Practices for Lesson 14

Chapter 13 - Page 21

b. Enter DELETION_FLAG in the Name field, select Numeric as the Datatype, and enter 0 

in the Default Value f ield. In the Action field, select Historize to enable viewing thehistory of all values for this variable.

c. Click the Refreshing tab. Select ORACLE_ORCL_LOCAL_SALES as the schema, and inthe Select Query field, enter the following expression. Click the Save button to save thevariable. Close the DELETION_FLAG variable tab.Note: To enter commands, refer to the file 14-2.txt provided at the followinglocation: c:\Labs\Text.

Page 316: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 316/449

 

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

Practices for Lesson 14

Chapter 13 - Page 22

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

5. Modify this package to have the Delete Target step running only if DELETION_FLAG isgreater than 0.

a. Duplicate the PKG_14-1 package. Open the package Copy of PKG_14-1 and renameit PKG_14-2. 

Page 317: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 317/449

 

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

Practices for Lesson 14

Chapter 13 - Page 23

b. Select the Diagram tab. In the project tree, and expand the Variables node. Drag theDELETION_FLAG variable from the tree view to the diagram. Click theDeletion_FLAG step and then 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.

Page 318: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 318/449

 

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

Practices for Lesson 14

Chapter 13 - Page 24

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

d. Right-click the Refresh Customer Count 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 Delete Target tables. Click the “Next step on failure” tool onthe Package toolbar, and link the step Flag > 0? to the Countries step, as shownbelow. Click Save to save the package. Close the tab.

Page 319: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 319/449

 

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

Practices for Lesson 14

Chapter 13 - Page 25

6. Run the new package and check if the Delete Target Tables step was executed.

a. Right-click the package PKG_14-2, and then select Execute. Click OK in the Executionwindow, and then click OK when the “Session started” message appears.

Page 320: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 320/449

 

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

Practices for Lesson 14

Chapter 13 - Page 26

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

Page 321: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 321/449

 

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

Practices for Lesson 14

Chapter 13 - Page 27

c. Open the Designer tab. Open the package PKG_14-2 again, and then select Diagram.To delete records from the target tables, select the Delete Target Tables step, right-click, and select Execute Step. Click OK in the Execution window, and then click OKwhen the “Session started” message appears.

Page 322: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 322/449

 

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

Practices for Lesson 14

Chapter 13 - Page 28

d. Now, when records from the target tables are deleted, execute the entire packagePKG_14-2 again. Click OK in the Execution window, and then click OK when the“Session started” message appears.

Page 323: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 323/449

 

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

Practices for Lesson 14

Chapter 13 - Page 29

e. Open the Operator and expand the latest session called INT_14-2. Verify that theDelete Target Tables step is no longer executed.

Note: Because the Customers tables were emptied by the execution of the DeleteTarget Tables step, the value of variable Flag >0? changes when refreshed to False,and the Delete Target Tables step is no longer executed. Close the PKG_14-2tab.

Page 324: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 324/449

 

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

Practices for Lesson 14

Chapter 13 - Page 30

Page 325: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 325/449

 

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

Practices for Lesson 15

Chapter 14 - Page 1

Practices for Lesson 15

Chapter 14

Page 326: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 326/449

 

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

Practices for Lesson 15

Chapter 14 - Page 2

Practice 15-1: Working with ODI Versions

Use Case Scenario:

In addition to the group of Interfaces created earlier, John needs to create a project and aninterface to export data from a flat file and load this data into a relational table. He also needs toverify the quality of the data loaded in the table.

Background:

In the previous practices, you learned how to create ODI Interfaces, which transform data fromone or more relational tables in the source to a relational table in the target.

In this practice, you take an interface and create a first version of it, version 1.0.0.0. Next, youchange some details of the interface’s mapping and create a second version of the interface,version 1.0.0.1.

Then you use the ODI Version Browser and Version Comparison tool to compare these twoversions of the interface and to detect the differences between them.

Finally, you generate a PDF report of the versions, and then restore the original version.

1. Create an interface

2. Create a new version 1.0.0.0 of the interface

3. Change the interface flow and create another version of the interface, version 1.0.0.14. Use the Version Browser to compare versions of the interface and create a version

comparison report

Note: Completing this practice is critical for all the following practice sessions.

 Your Tasks:

1. Create a new Interface with Oracle Data Integrator.

a. If not connected, connect to the ODI work repository DEV_ODI_REPO. Log in with thefollowing details. Click OK.

•  Login name: DEV_ODI_REPO

•  User: SUPERVISOR

•  Password: SUNOPSIS.

Page 327: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 327/449

 

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

Practices for Lesson 15

Chapter 14 - Page 3

b. In Designer, click the Projects tab. Expand HandsOnLoads > HandsOn > Interfaces,and select INT_9-1. Right-click this interface and select Duplicate. In the Confirmationwindow, click Yes.

Page 328: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 328/449

 

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

Practices for Lesson 15

Chapter 14 - Page 4

c. Double-click Copy of INT_9-1. Name the new interface INT_15-1. Click Save tosave the interface. Close the INT_15-1 tab.

2. Create new versions of INT_15-1.

Page 329: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 329/449

 

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

Practices for Lesson 15

Chapter 14 - Page 5

a. To create a new version of INT_15-1: Right-click INT_15-1 and select Version >Create Version. On the screen that follows, view the suggested version number. Leavethis default number. Click OK.

Page 330: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 330/449

 

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

Practices for Lesson 15

Chapter 14 - Page 6

b. Double-click INT_15-1 to edit it. Click the Flow tab. On the flow tab, click TargetDatastore. Select the Distinct Rows check box. Click the Save button and close yourinterface tab.

c. To create another version of this modified Interface, right-click INT_15-1 and selectVersion > Create Version. On the screen that follows, click the Previous Versions

Page 331: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 331/449

 

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

Practices for Lesson 15

Chapter 14 - Page 7

button.

d. View the previous (original) version of your interface. Optionally, enter the descriptionof the new version in the Description field. Click OK to save your new version.

Page 332: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 332/449

 

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

Practices for Lesson 15

Chapter 14 - Page 8

e. Now, you explore your versions by using the Version Browser. Click ODI > VersionBrowser. View your versions with all the necessary information.

Page 333: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 333/449

 

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

Practices for Lesson 15

Chapter 14 - Page 9

3. Compare the newly created version.

a. With Version Browser open, select both versions: (1.0.0.0) and (1.0.0.1) for interface

INT_15-1. Right-click the selected versions and select Compare.

Page 334: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 334/449

 

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

Practices for Lesson 15

Chapter 14 - Page 10

b. Select Modified Fields and deselect other check boxes. Now you have a more compactview of your changes. Click the Print button.

c. On the Report generation screen, select the New objects check box. Click buttonto specify the PDF file location.

Page 335: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 335/449

 

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

Practices for Lesson 15

Chapter 14 - Page 11

d. Specify the PDF file location: C:\Documents and Settings\Administrator\My

Documents\. Name your report: Practice 15-1 Interfaces comparison.Click Save. Your report will be saved in C:\Documents and

Settings\Administrator\My Documents\Practice 15-1 Interfaces comparison. ClickGenerate. Click OK.

Page 336: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 336/449

 

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

Practices for Lesson 15

Chapter 14 - Page 12

e. Open your PDF file with your report. Scroll down to view the report. Close the report.Click OK to close the Versions Comparison tool.

Page 337: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 337/449

 

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

Practices for Lesson 15

Chapter 14 - Page 13

Page 338: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 338/449

 

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

Practices for Lesson 15

Chapter 14 - Page 14

4. Restore the original version of your interface.

a. In the Version Browser, select INT_15-1 version 1.0.0.0, and click the Restore this

version icon. Click OK. Click OK again.

Page 339: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 339/449

 

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

Practices for Lesson 15

Chapter 14 - Page 15

b. In the Objects tab, double-click interface INT_15-2. Click the Version tab. View yourcurrent restored version: 1.0.0.0. Click OK.

Page 340: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 340/449

 

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

Practices for Lesson 15

Chapter 14 - Page 16

Page 341: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 341/449

 

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

Practices for Lesson 16

Chapter 15 - Page 1

Practices for Lesson 16

Chapter 15

Page 342: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 342/449

 

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

Practices for Lesson 16

Chapter 15 - Page 2

Practice 16-1: Creating and Scheduling an ODI Scenario

Use Case Scenario: 

Earlier, John created the ODI procedure to create a relational table and populate it with data.Now John needs to create an ODI scenario and schedule its execution.

Background:

 A common task that is performed by using ODI is to create an ODI scenario and schedule itsexecution. You already developed the ODI procedure that creates a relational table andpopulates the relational table with data.

In this practice, you learn how to create and schedule an ODI scenario to run the procedure youcreated in Practice 12-1.

First, in the Designer Navigator’s Projects tab, you generate a scenario for the PRD-create-populate-table procedure.

Then, in Topology Navigator, you verify connection to ODI Agent.

Next, in Designer Navigator, you schedule the scenario with ODI Agent.

You switch back to Topology Navigator to review the scheduling of the agent.

Finally, in Operator Navigator, after the scheduled scenario execution time, you verify that the

scenario has executed. 

 Your Tasks: 1. Create a new scenario with Oracle Data Integrator.

a. If not connected, connect to the Work repository WORKREP. Select DEV_ODI_REPOfrom the Login Name drop-down list. Enter SUPERVISOR in the User field andSUNOPSIS in the Password field. Click OK to log in.

Page 343: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 343/449

 

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

Practices for Lesson 16

Chapter 15 - Page 3

b. In ODI Designer, click the Projects tab. On the Projects tab, expand the project:Procedure-CRT-TBL > First Folder > Procedures. Right-click the PRD-create-populate-table procedure and select Generate Scenario. 

c. Name the scenario PRD_CREATE_POPULATE_TABLE. Set the Version to 001. ClickOK. 

Page 344: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 344/449

 

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

Practices for Lesson 16

Chapter 15 - Page 4

d. Expand the PRD-create-populate_table procedure and expand Scenarios. Right-clickthe PRD_CREATE_POPULATE_TABLE scenario to view the possible options, asshown in the following screen.

Note: The scenario has now been successfully created. You can now execute thescenario directly, use the scenario within a package, or schedule the scenario withinODI. 

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

a. In Topology Navigator, verify connection to ODI agent, as shown in the followingscreen.

Note: If ODI Agent is not set up and running, you must perform the steps specified inPractice 3-1 before continuing.

Page 345: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 345/449

 

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

Practices for Lesson 16

Chapter 15 - Page 5

b. Expand the PRD-create-populate-table procedure. Expand Scenarios >PRD_CREATE_POPULATE_TABLE Version 001. Right-click Scheduling and selectNew Scheduling.

Note: To schedule a scenario, an ODI Agent must be set up. If an ODI Agent is not setup within the ODI Topology Manager, perform Practice 3-1, “Setting Up and Installingan ODI Agent.”

Page 346: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 346/449

 

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

Practices for Lesson 16

Chapter 15 - Page 6

c. On the screen that follows, select the agent where the scheduled scenario will run:localagent. Set Context as Development and log level to 5. Set Execution to Simple

and click the button. Set the execution time to approximately five minutes from thecurrent system time, as shown in the following screen. Click the Save button.

Page 347: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 347/449

 

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

Practices for Lesson 16

Chapter 15 - Page 7

d. Expand Scheduling and verify that the DEVELOPMENT / localagent entry is nowinserted under Scheduling. 

Page 348: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 348/449

 

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

Practices for Lesson 16

Chapter 15 - Page 8

e. Start Topology Manager to review the scheduling of the Agent. In the Physicalarchitecture, expand the Agents node and double-click localagent. On the localagent  screen, click Update Schedule. On the screen that follows, click OK. Click OK again. 

Page 349: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 349/449

 

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

Practices for Lesson 16

Chapter 15 - Page 9

f. Click the View Schedule button. The screen that appears shows you the schedulinginformation. Click OK to close schedule. Close the tabs: Localagent tab and ScenarioScheduling. 

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

a. Click the ODI Operator tab to open ODI Operator. In ODI Operator, click the SessionList tab. Wait until the scheduled execution time to view the execution results, and thenclick the Refresh icon.

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

Page 350: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 350/449

 

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

Practices for Lesson 16

Chapter 15 - Page 10

Page 351: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 351/449

 

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

Practices for Lesson 17

Chapter 16 - Page 1

Practices for Lesson 17

Chapter 16

Page 352: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 352/449

 

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

Practices for Lesson 17

Chapter 16 - Page 2

Practice 17-1: Enforcing Data Quality with ODI Interface

Use Case Scenario:

John is responsible for data loading, transformation, and validation. He created a project and aninterface to export data from a flat file and load this data into a relational table. Now John needsto verify the quality of data loaded in the table.

Background:

In the previous practices, you learned how to create ODI Interfaces, which transform data fromone or more relational tables in the source to a relational table in the target and to export datafrom a flat file to a relational table. In this practice, you perform data quality control for theinterface created in Practice 10-1.

First, for a certain datastore, you verify that the primary key constraint is marked static, and twocolumns are marked mandatory with static control.

You then create an interface using that datastore as a target.

In the interface’s Flow tab, you set STATIC_CONTROL to True. In the Controls tab, you ensurethe knowledge module is set to CKM SQL (a knowledge module that you will import) and youset maximum allowed errors to 5.

For two columns in the target datastore, you will select the Check Not Null check box so thatcontrol errors will be generated if these columns are not loaded.

You will run the interface with Flow Control set to FALSE. You will verify that there are controlerrors on three records, and that the three records with errors were loaded into the targetdatastore.

Finally, you will rerun the interface, with Flow Control set to TRUE, and verify that errors areexcluded from the target datastore.

Note: Completing this practice is critical for all the following practice sessions.

 Your Tasks:

Page 353: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 353/449

 

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

Practices for Lesson 17

Chapter 16 - Page 3

1. If not connected, connect to the Work repository, WORKREP. To connect, click Connect toRepository. Select DEV_ODI_REPO from the Login Name drop-down list. EnterSUPERVISOR in the User field and SUNOPSIS in the Password field. Click OK to login.

2. Modify INT-Exp-FF-RT (created in Practice 10-1) to enable checking data quality in thetarget table.

a. Click the Projects tab. Select Knowledge Modules > Check (CKM). Right-click Check(CKM) and select Import Knowledge Modules:

Page 354: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 354/449

 

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

Practices for Lesson 17

Chapter 16 - Page 4

b. In the File import directory field, select CKM SQL and click OK. Close the ImportReport  window. Verify that CKM SQL was successfully imported and is shown in thetree view.

Page 355: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 355/449

 

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

Practices for Lesson 17

Chapter 16 - Page 5

c. In the Models tab, expand Oracle_RDBMS1 > TRG_SALES_PERSON > Constraints,and then double-click TRG_SALES_PERSON_PK. Click the Control tab and verify thatStatic is selected.

d. In the model Oracle_RDBMS1, expand TRG_SALES_PERSON > Columns, double-

click the column LAST_NAME, and then click the Control tab. Select Static to enablestatic control. Select the Mandatory check box. Click the Save button. Repeat the samestep to enable Static control for the DATE_HIRED column. Save your changes andclose the tabs.

Page 356: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 356/449

 

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

Practices for Lesson 17

Chapter 16 - Page 6

e. In the Projects tab, expand the Export-FF-RT project, and then duplicate the interfaceINT-EXP-FF-RT. Open the copy of the interface and rename it as INT-EXP-FF-RT-Quality, and then click the Mapping tab.

Page 357: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 357/449

 

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

Practices for Lesson 17

Chapter 16 - Page 7

f. Delete the filter for the column SALES_PERSON_ID, as shown in the following screen,and then click the Flow tab.

Page 358: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 358/449

 

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

Practices for Lesson 17

Chapter 16 - Page 8

g. In the Flow tab, Click Target + Staging Area (ODI_STAGE) to open the Optionssection. Set the static control option to true. Click the Controls tab.

Page 359: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 359/449

 

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

Practices for Lesson 17

Chapter 16 - Page 9

h. On the Controls tab, ensure that your KM is set to CKM SQL. Set the maximumnumber of errors allowed to 5. Leave the other options with the default values. Click theMapping tab.

i. In Target Datastore, select the LAST NAME column, and then select the Check Not

Null check box. Repeat the same step for the DATE HIRED column. Click the Save button to save your changes.

Page 360: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 360/449

 

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

Practices for Lesson 17

Chapter 16 - Page 10

 j. Execute your Interface . Click the Execution tab to view the execution results withthe number of errors, as shown in the screen.

Note: You may need to click the Refresh icon to view your last execution.

Page 361: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 361/449

 

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

Practices for Lesson 17

Chapter 16 - Page 11

k. On the Models tab, right-click the TRG_SALES_PERSON target datastore and selectControl > Errors. View the records with errors as shown in the screen:

l. Right-click the TRG_SALES_PERSON datastore and select View Data. Verify that therows with errors are still inserted in the target datastore. Close theTRG_SALES_PERSON data tabs.

Page 362: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 362/449

 

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

Practices for Lesson 17

Chapter 16 - Page 12

m. Click the INT-EXP-FF-RT-Quality tab. On the Interface screen, click the Flow tab.

Set Flow Control to true. Save your changes, and then execute the interface .

Page 363: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 363/449

 

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

Practices for Lesson 17

Chapter 16 - Page 13

n. On the Models tab, right-click TRG_SALES_PERSON and select View Data. Verify thatthe rows with errors are excluded from the data in the target datastore. Close the tabs.

Page 364: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 364/449

 

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

Practices for Lesson 17

Chapter 16 - Page 14

Page 365: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 365/449

 

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

Practices for Lesson 18

Chapter 17 - Page 1

Practices for Lesson 18

Chapter 17

Page 366: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 366/449

 

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

Practices for Lesson 18

Chapter 17 - Page 2

Practice 18-1: Implementing Changed Data Capture

Use Case Scenario: 

 As a database administrator, John is responsible for data loading, transformation, andvalidation. He wants to be able to detect changes in his source environment. For that purpose,he needs to implement Changed Data Capture in his data integration project.

Background:

 A common task that is performed by using ODI is to implement Changed Data Capture. In thispractice, students implement Changed Data Capture to detect changes in the sourceenvironment for the interface created earlier in Practice 8-1. You will capture changes of data inthe SRC_CITY table in the Oracle Sales Application model. Then, you modify the interface toprocess changed records only.

In this practice, you perform change data capture in an interface, using the JKM OracleSimple knowledge module.

First, you import this knowledge module, and create a model by using this journalizingknowledge module.

Then you create an interface by using the IKM Oracle Incremental Update knowledgemodule, specifying capture of journalized (changed) data only.

1. Import the JKM Oracle Simple knowledge module.

2. Create a model, Oracle_RDBMS2, specifying this knowledge module in the Journalizingtab.

3. Reverse-engineer the model, verifying the resulting structure.

4. Add the models’ SRC_SALES_PERSON table to CDC, and start the Journal by using thedefault subscriber SUNOPSIS.

5. Use Data viewer to change data in the table and verify in Journal Data that the data changewas captured.

6. Create an interface to process changed data only.

 Your Tasks:

1. Import the appropriate JKM in the project.

a. If not open, log in to the WORKREP Work repository with the login nameDEV_ODI_REPO (enter SUPERVISOR for username and SUNOPSIS for password).

Page 367: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 367/449

 

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

Practices for Lesson 18

Chapter 17 - Page 3

b. Click the Projects tab. Expand the Procedure-CRT-TBL > Knowledge Modules node,right-click Journalization (JKM), and select Import Knowledge Modules.

c. Select JKM Oracle Simple to import and click OK. Close Import Report.

Page 368: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 368/449

 

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

Practices for Lesson 18

Chapter 17 - Page 4

d. In the Models tab, create a new model named Oracle _RDBMS2. For Technology,enter: Oracle. Select the logical schema ODI_STAGE. Click the Reverse Engineer taband set Context to development. Verify the setting, as shown in the following screen.

Click the Journalizing tab.Note: The table SRC_SALES_PERSON was created in the ODI_STAGE schema in Practice13-1.

Page 369: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 369/449

 

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

Practices for Lesson 18

Chapter 17 - Page 5

e. In the Knowledge Module menu, select JKM Oracle Simple.Procedure-CRT-

TBL, as shown in the following screen. Click the Save icon to save your model andthen close the tab.

f. Reverse-engineer the model Oracle_RDBMS2. Expand this model and verify its

structure as follows.

Page 370: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 370/449

 

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

Practices for Lesson 18

Chapter 17 - Page 6

2. Set up the CDC Infrastructure. You will start the CDC on the SRC_SALES_PERSON table inthe Oracle_RDBMS2 model.

a. To add the table to CDC, expand the Oracle_RDBMS2 model, right-click theSRC_SALES_PERSON table, and select Change Data Capture > Add to CDC. Click Yesto confirm.

Page 371: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 371/449

 

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

Practices for Lesson 18

Chapter 17 - Page 7

b. Click the Refresh icon. The small yellow clock icon is added to the table

. Right-click the SRC_SALES_PERSON table again and selectChanged Data Capture > Start Journal.

Page 372: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 372/449

 

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

Practices for Lesson 18

Chapter 17 - Page 8

c. In this practice, you use the default subscriber SUNOPSIS. For that reason, you do nothave to add another subscriber. Click OK to confirm that your subscriber isSUNOPSIS. In the Information window, click OK again. Wait several seconds, then

click Refresh and verify that the tiny clock icon at the SRC_SALES_PERSON table is

green now . This means that your journal has started properly.

Page 373: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 373/449

 

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

Practices for Lesson 18

Chapter 17 - Page 9

d. Click the ODI Operator icon to open the Operator. Click Refresh. Select All Executionsand verify that the SRC_SALES_PERSON session executed successfully.

3. View the data and the changed data.

a. In the Designer window, open the Models tab. Right-click the SRC _ SALES_PERSON datastore and select Data.

b. Select the row with SALES_PERSON _ ID = 11. Change the value of the LASTNAME column to “Anderson”. Similarly, select the row with SALES_PERSON_ID = 51, andthen change the value to “Smith”. Save your changes and close the tab.

Page 374: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 374/449

 

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

Practices for Lesson 18

Chapter 17 - Page 10

c. Right-click the table again and select View Data. Scroll down, and verify that the rowsare modified. Close the tab.

Page 375: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 375/449

 

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

Practices for Lesson 18

Chapter 17 - Page 11

d. To verify that your changed data is captured, right-click SRC_SALES_PERSON, andselect Change Data Capture > Journal Data. Find the captured changed records in the

 journal data. Close the tab.

Page 376: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 376/449

 

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

Practices for Lesson 18

Chapter 17 - Page 12

4. Create an interface that processes captured data changes. The interface loads theTRG_SALES_PERSON_CDC datastore in the Oracle_RDBMS1 model with the content of theSRC_ SALES_PERSON table from the Oracle_RDBMS2 model. The purpose of thisinterface is to process and load only changed data.

a. First you need to add one more knowledge module. In ODI Designer, click the Projectstab, and then expand the Export-FF-RT project. Import the new Knowledge Module:IKM Oracle Incremental Update. Close the report.

Page 377: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 377/449

 

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

Practices for Lesson 18

Chapter 17 - Page 13

Page 378: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 378/449

 

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

Practices for Lesson 18

Chapter 17 - Page 14

b. Now you need to create one more target datastore to store only changed data. In theModels tab, expand OracleRDBMS1, duplicate the TRG_SALES_PERSON datastore,and rename the copy as TRG_SALES_PERSON_CDC. Save the

TRG_SALES_PERSON_CDC  datastore and then close the tab.

Page 379: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 379/449

 

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

Practices for Lesson 18

Chapter 17 - Page 15

c. Open data in the TRG_SALES_PERSON_CDC datastore, and then click the DeleteCurrent Row icon repeatedly to delete all the rows. Save your changes and close thetab.

Page 380: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 380/449

 

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

Practices for Lesson 18

Chapter 17 - Page 16

d. In the Projects tab, expand Export-FF-RT > First Folder > Interfaces. Right-clickInterfaces, and then select New Interface.

e. In the Interface: NEW window, enter INT_SALES_PERSON_CDC as the name of theinterface. Ensure that the Optimization Context is Development. Click the Mapping tab.

f. Open the Models tab. In the tree view, expand the Oracle_RDBMS1 model. Drag theTRG_SALES_PERSON_CDC datastore from the tree view to the Target Datastore zone.Expand the Oracle_RDBMS2 model and drag the SRC_ SALES_PERSON datastore 

Page 381: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 381/449

 

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

Practices for Lesson 18

Chapter 17 - Page 17

from the model tree to the Sources zone of your diagram. Click Yes to performautomatic mapping. Save your interface.

Page 382: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 382/449

 

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

Practices for Lesson 18

Chapter 17 - Page 18

g. Right-click the caption of the source datastore and select Data. Scroll down to previewthe current source data. Close the Data window.

Page 383: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 383/449

 

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

Practices for Lesson 18

Chapter 17 - Page 19

h. Click the Flow tab, click the Staging Area caption, and verify that the selected IKM isIKM Oracle Incremental Update. Select Distinct Rows.

Page 384: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 384/449

 

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

Practices for Lesson 18

Chapter 17 - Page 20

i. Now you modify this interface to process only the changed data. Click the Mapping tab. Click the source datastore. In the Diagram property panel, select the JournalizedData only check box.

Page 385: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 385/449

 

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

Practices for Lesson 18

Chapter 17 - Page 21

 j. To check the new source data set, repeat step d. View your data again. Only the

changed data should be visible. Close the data window.

Page 386: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 386/449

 

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

Practices for Lesson 18

Chapter 17 - Page 22

k. Save your interface and close the tab. Execute the interface to process only journalizedrecords.

5. Verify the execution results.

a. Open the Operator. Click Refresh. Expand the All Executions node and verify that yoursession, INT_SALES_PERSON_CDC, executed successfully.

b. View the data in the TRG-SALES_PERSON_CDC datastore and verify that only threechanged rows are inserted in the target datastore.

Page 387: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 387/449

 

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

Practices for Lesson 18

Chapter 17 - Page 23

6. In the Models tab, right-click the SRC_SALES_PERSON datastore and select Drop Journal.Click OK, and then click OK again. Right-click the SRC_SALES_PERSON datastore again,and then select Remove from CDC. Click Yes to confirm removing the datastore from CDC.

Page 388: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 388/449

 

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

Practices for Lesson 18

Chapter 17 - Page 24

Page 389: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 389/449

 

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

Practices for Lesson 18

Chapter 17 - Page 25

Page 390: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 390/449

 

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

Practices for Lesson 18

Chapter 17 - Page 26

Page 391: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 391/449

 

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

Practices for Lesson 19

Chapter 18 - Page 1

Practices for Lesson 19

Chapter 18

Page 392: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 392/449

 

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

Practices for Lesson 19

Chapter 18 - Page 2

Practice 19-1: Setting Up ODI Security

Use Case Scenario: 

 As a database administrator at FN Enterprise, John is responsible for performing databasemanagement and integration tasks on various resources within the organization. John is alsoresponsible for enforcing the ODI security policies. To set his ODI environment, he needs to setup the security with ODI.

Background: 

Using the ODI Security Manager module, you can manage security in Oracle Data Integrator.

In this practice, you explore the security features of ODI Security Manager. You create a profile,grant 3 methods (actions) to the profile, and create a new ODI user to whom you assign thatprofile.

You then assign the profile to your new user, and grant a specific method (View) for a specificobject (Scheduling) for your new user. You also define user parameters that enable specificfunctionality for your new user.

Finally, you define password policies that control the case sensitivity and length of user-definedpasswords.

1. In ODI Security Navigator, expand the Profiles panel and duplicate the Repository Explorerprofile, naming the new profile REVIEWER. You grant three methods to the REVIEWER profile: “Compare with version,” “Duplicate,” and “Export from object Model.”

Note: You may need to click the View menu and open the Security Navigator.

2. Create a new ODI user, INT_PROJECT_REVIEWER.

3. Assign the new profile REVIEWER to your newly created user. To connect to ODI Masterand Work repositories, assign the built-in profile CONNECT, to the new user

INT_PROJECT_REVIEWER.

4. Grant the View method for the Scheduling object to user INT_PROJECT_REVIEWER.

5. Define user parameters to enable specific functionality for INT_PROJECT_REVIEWER.

6. Define password policies to enforce passwords to be uppercase and greater than 8characters.

 Your Tasks:

1. To define an ODI security policy, you need to create an appropriate profile for workingmethods used in your project.

a. Start Oracle Data Integrator and connect to the Master repository. For Login Name,enter Master Repository. Enter SUPERVISOR for user and SUNOPSIS forpassword. Click the Profiles tab.

Page 393: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 393/449

 

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

Practices for Lesson 19

Chapter 18 - Page 3

b. From the View menu, open the ODI Security Navigator. Open the Profiles tab. Right-click the generic REPOSITORY EXPLORER profile and select Duplicate Selection. ClickYes to confirm.

Page 394: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 394/449

 

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

Practices for Lesson 19

Chapter 18 - Page 4

c. Double-click Copy of REPOSITORY EXPLORER to edit.

d. Rename your new profile REVIEWER. Click the Save button to save this profile. Theprofile REVIEWER appears in the Profiles tree structure.

Page 395: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 395/449

 

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

Practices for Lesson 19

Chapter 18 - Page 5

2. Assign the appropriate authorizations to REVIEWER.

a. Open the Objects Tab. In the Profiles tab, expand REVIEWER > Model, as shownbelow. Only the View method is permitted for Model now.

Page 396: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 396/449

 

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

Practices for Lesson 19

Chapter 18 - Page 6

b. In the Objects tab, expand Model and select the method Compare with Version.Drag the Compare with Version method to the profile REVIEWER. In theConfirmation window, click Yes.

Page 397: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 397/449

 

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

Practices for Lesson 19

Chapter 18 - Page 7

c. Repeat step c to add the methods Duplicate and Export... to the profileREVIEWER. In Profiles, expand REVIEWER > Model, and verify that the methods

Page 398: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 398/449

 

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

Practices for Lesson 19

Chapter 18 - Page 8

Compare with version, Duplicate, and Export... are added to the objectModel, as shown in the following screen. Save the profile REVIEWER and close the tab.

3. Create a new ODI user.

a. Click the Users tab and select New user. The New User window opens.

Page 399: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 399/449

 

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

Practices for Lesson 19

Chapter 18 - Page 9

b. Name the new user: INT_PROJECT_REVIEWER. Click Enter a password.

c. Enter the password (INTEGRATION), and then confirm this password. Do not select the

“Allow expiration date” check box. Click OK. Click the Save button to save this newuser. User INT_PROJECT REVIEWER is now displayed in the Users tree structure.

Page 400: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 400/449

 

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

Practices for Lesson 19

Chapter 18 - Page 10

4. Assign the profile REVIEWER to user INT_PROJECT_REVIEWER.a. Make sure that both the Profiles and Users panels are displayed together in ODI

Security Navigator. Click the profile REVIEWER in the Profiles panel and drag it to userINT_PROJECT REVIEWER in the Users panel. Click Yes to confirm granting the profile.

Page 401: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 401/449

 

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

Practices for Lesson 19

Chapter 18 - Page 11

b. In the Users panel, expand the INT_PROJECT REVIEWER > Profiles node andverify that profile REVIEWER was assigned to this user.

c. To connect to ODI Master and Work repositories and other objects, assign the built-inprofile CONNECT to your new user. Select the profile CONNECT and drag it to userINT_PROJECT REVIEWER. Click Yes to confirm granting CONNECT to your new user.

Page 402: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 402/449

 

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

Practices for Lesson 19

Chapter 18 - Page 12

d. Verify that the profiles CONNECT and REVIEWER are added to your new user:

e. You can also grant privileges to use certain methods for objects directly to your user.Ensure that the Objects and Users panels are open. In the Objects panel, scroll downand then expand the object Scheduling. Select View. Drag this method toINT_PROJECT REVIEWER.

Page 403: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 403/449

 

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

Practices for Lesson 19

Chapter 18 - Page 13

f. Verify that authorization to the object Scheduling with the method View was addedto user INT_PROJECT_REVIEWER, as shown in the following screen.

5. Connect your new user to the ODI Work repository and verify your access to ODI artifacts.

Page 404: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 404/449

 

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

Practices for Lesson 19

Chapter 18 - Page 14

a. From the ODI menu, select Disconnect “DEV_ODI_REPO”. Connect to your workrepository as the newly created user. Select DEV_ODI_REPO for the Login Name.Enter INT_PROJECT_REVIEWER for the user and INTEGRATION for the password.

b. In the Designer tab, click the Projects tab and Models tab, and then expand yourprojects and models to verify that you have access to view all your artifacts.

Page 405: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 405/449

 

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

Practices for Lesson 19

Chapter 18 - Page 15

6. Define user parameters so that the user can enable specific ODI functionality. Ensure that ahelp message is displayed if an interface diagram is empty and objects remain unlockedwhen opening. In addition, you may want to set a delay between two refreshes in secondsand the number of elements displayed in a branch of the Operator tree view.

a. In ODI Security Manager, select ODI > User Parameters.

Page 406: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 406/449

 

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

Practices for Lesson 19

Chapter 18 - Page 16

b. Edit the user parameters as shown in the following table. Click OK. Click the ODI menuand select Disconnect DEV_ODI_REPO to close this user connection.

 Parameter Value Functionality

Help for Interface Diagram 1Display a Help message when the Interface

Diagram is empty

Lock object when opening 0 Lock object when opening

Delay between tworefreshes (seconds)

2Inter-refresh delay

Operator Display limit

(0=no limit)

200 Number of elements displayed in a branch of the

Operator tree view

Page 407: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 407/449

 

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

Practices for Lesson 19

Chapter 18 - Page 17

7. Open your connection with user SUPERVISOR. Select Security Navigator. DefinePassword Policies. These policies consist of a set of rules that will be checked when thepassword is defined by the user.

a. From the ODI menu, select Disconnect “DEV_ODI”REPO”. Connect toDEV_ODI_REPO with user SUPERVISOR. For the password, enter SUNOPSIS. Open

Security Navigator. Click the icon, and then select Password policy. Click theAdd a Policy icon.

Page 408: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 408/449

 

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

Practices for Lesson 19

Chapter 18 - Page 18

b. Name this policy Policy 1. Enter the rule description as shown in the followingscreen. Set Conditions to match to All. In the Rules section, click Text and select isuppercase. Click the add rule button (with the + sign).

c. Enter another rule: Length >= 8. Click OK.

Page 409: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 409/449

 

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

Practices for Lesson 19

Chapter 18 - Page 19

d. On the screen that follows, select the Active check box. Select the Passwords arevalid for  check box, and set it to 30 days. Click OK to save this Password policy. ClickOK again. Close the Security Navigator  tab.

Page 410: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 410/449

 

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

Practices for Lesson 19

Chapter 18 - Page 20

Page 411: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 411/449

 

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

Practices for Lesson 19

Chapter 18 - Page 21

Practice 19-2: Integration with Enterprise Manager and Using ODIConsole

Use Case Scenario: 

Oracle Data Integrator provides an extension integrated into the Fusion Middleware ControlConsole (Enterprise Manager). The Oracle Data Integrator components can be monitored as adomain through this console, and administrators can have a global view of these components,

along with other Fusion Middleware components from a single administration console. Johndecided to begin using this feature. He created the Web Logic Server (WLS) domain, ODI-DOMAIN. Now John needs to deploy and configure the ODI Java EE Agent with the existingWLS domain. He also needs to configure the ODI Enterprise Manager and ODI Console Plug-in with WLS.

Background:

In this lab, you perform the steps needed to deploy and configure the ODI Java EE Agent,Enterprise Manager11g, and ODI Console plug-in to an existing WLS domain. You useEnterprise Manager 11g and ODI Console to access your ODI objects.

1. Deploy and configure the ODI Java EE agent, Enterprise Manager, and ODI Consolewith the existing WebLogic domain.

2. Connect to the WebLogic Server and managed server, odi_server1.3. Use Enterprise Manager to administer ODI.

4. Use ODI Console to explore the ODI environment.

 Your Tasks:

1. Deploy and configure the ODI Java EE agent and Enterprise Manager on the existingWebLogic domain, 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. Verifythat the Web application context is set to oraclediagent, as shown below. Saveyour new physical agent.

Note: The agent name is case-sensitive! Use the exact name OracleDIAgent, asshown in the following screen.

Page 412: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 412/449

 

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

Practices for Lesson 19

Chapter 18 - Page 22

b. In the Logical architecture, create a new logical agent with the same name as your newphysical agent, OracleDIAgent. Link this logical agent to the physical agent

OracleDIAgent in all three contexts, as shown below.

c. Extend the WebLogic server domain ODI-DOMAIN with the ODI agent application.

d. To deploy and configure domains with WLS, you start the config.bat file from the ODIHome Install directory – C:\Oracle\Middleware\Oracle_ODI1\common\bin.Start the command shell and change directory to

Page 413: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 413/449

 

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

Practices for Lesson 19

Chapter 18 - Page 23

C:\Oracle\Middleware\Oracle_ODI1\common\bin. Execute the commandconfig, which starts the Configuration Wizard.

e. Select Extend an Existing WebLogic Domain, and then click Next.

f. Select the WebLogic domain directory ODI-DOMAIN, as shown below. Click Next.

Page 414: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 414/449

 

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

Practices for Lesson 19

Chapter 18 - Page 24

g. In the screen that follows, select Oracle Data Integrator – Agent – 11.1.1.1 (OracleJRF will then also be selected; leave this option selected). Select the OracleEnterprise Manger Plugin For ODI – 11.1.1.0, which will also include the OracleEnterprise Manager – 11.1.1.0. Also select Oracle Data Integrator-Console-11.1.1.0.Click Next. In the screen that follows, click OK to replace the existing component.

Page 415: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 415/449

 

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

Practices for Lesson 19

Chapter 18 - Page 25

h. In the next screen, accept the default application location. Click Next.

Page 416: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 416/449

 

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

Practices for Lesson 19

Chapter 18 - Page 26

i. The wizard will set up the ODI repository connection within the domain server. Duringthe wizard configuration, the repository connection information must be supplied. Clickthe check boxes next to ODI Master schema, and next to ODI Work schema. Configurethe JDBC component schema as shown in the following table. Click Next.

Database Connection (Master Repository)

Parameter Value

Vendor Oracle 

Driver Oracle’s driver (Thin) forService connections 

Schema Owner DEV_ODI_REPO

Schema Password oracle1

DBMS/Service orcl

Host Name localhost

Port 1521

Page 417: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 417/449

 

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

Practices for Lesson 19

Chapter 18 - Page 27

 j. Verify that the test was successful (if not, correct any connectivity settings). Click Next.

k. In the next screen, select Managed Servers, Clusters and Machines. Click Next.

Page 418: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 418/449

 

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

Practices for Lesson 19

Chapter 18 - Page 28

l. Set Listen port to 8002 for managed server odi_server1. Click Next.

m. In the Configure Clusters screen, click Next.

Page 419: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 419/449

 

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

Practices for Lesson 19

Chapter 18 - Page 29

n. In the Configure Machines screen, click Next.

o. The Assign Servers to Machines screen will already have the odi_server1 assigned tolocalODImachine. Click Next.

Page 420: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 420/449

 

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

Practices for Lesson 19

Chapter 18 - Page 30

p. Review the Configuration Summary, and then click Extend. When the domain iscreated, click Done.

Page 421: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 421/449

 

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

Practices for Lesson 19

Chapter 18 - Page 31

2. Connect to the WebLogic server and managed server odi_server1.

a. In the command shell, change directory to the directory of the WLS Home -C:\Oracle\Middleware\user_projects\domains\ODI-DOMAIN\bin. Executethe startweblogic command.

Page 422: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 422/449

 

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

Practices for Lesson 19

Chapter 18 - Page 32

b. Security must be set up for the JAVA EE application to have access to the ODI

repository. The entry will be created within the credential store, which will allow theJAVA EE Agent to authenticate itself to be able to use the required resources. Thisuser should be a user that is already set up in the ODI Security. In this practice, we useuser SUPERVISOR. To do this, you execute Web Logic Scripting Tool (WLST),connect to our running Admin server and add the credential store. To start WLST, inthe new command window, change directory to the WLS_HOME common bin -C:\Oracle\Middleware\oracle_common\common\bin, and then execute thecommand wlst. 

c. To connect to the running Admin server, execute the following command:connect('weblogic','welcome1','t3://localhost:7002') 

Page 423: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 423/449

 

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

Practices for Lesson 19

Chapter 18 - Page 33

d. Execute the following command to add the correct credential store for ODI Supervisor :createCred(map="oracle.odi.credmap", key="SUPERVISOR",user="SUPERVISOR", password="SUNOPSIS", desc="ODI SUPERVISORCredential").

 Also execute the command to add the correct credential store for the domain ODI-DOMAIN:

createCred(map="oracle.odi.credmap", key="ODI-DOMAIN",user="weblogic", password="welcome1", desc="ODI-DOMAINCredential").To exit WLST, execute the command exit().

Note: All commands are case-sensitive! You can copy commands from the text file19-2.txt provided in the c:\LABS\text folder.

Note: During run time, the JAVA EE Agent will access this credential store authentication. 

e. To start managed server odi_server_1, change directory to WLS Home -

C:\Oracle\Middleware\user_projects\domains\ODI_DOMAIN\bin, and usethe execute command StartManagedWeblogic odi_server1. For Username,enter weblogic. For the password, enter welcome1. Verify that your managed serveris started in RUNNING mode.

Page 424: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 424/449

 

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

Practices for Lesson 19

Chapter 18 - Page 34

f. From ODI Designer, test connectivity of your configured ODI Java EE agent. Click OK.

Page 425: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 425/449

 

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

Practices for Lesson 19

Chapter 18 - Page 35

3. Use Enterprise Manager to administer ODI.

a. Start the browser and enter http://localhost:7002/em. Log in to EnterpriseManager. For the user, enter weblogic. For the password, enter welcome1. On thescreen that follows, click Continue.

b. With Enterprise Manager, a process and resources can be monitored and managed.You can explore the deployed application by clicking on each link. You can see

Page 426: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 426/449

 

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

Practices for Lesson 19

Chapter 18 - Page 36

running processes, workload, log file information, and more. Drill down into ODI objectsby expanding ODI in the left panel, as shown in the following screen.

c. Expand odiconsole node. Then click MASTER REPOSITORY to view more details.Note: Your information may differ from the information provided on these screens.

Page 427: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 427/449

 

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

Practices for Lesson 19

Chapter 18 - Page 37

d. Click the OracleDIAgent to see the Java EE agent information.

e. Click the localagent node to see details for the standalone agent.

Page 428: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 428/449

 

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

Practices for Lesson 19

Chapter 18 - Page 38

f. Expand the Application Deployment node, and then click oraclediagent. View theWebLogic server application deployment information.

Page 429: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 429/449

 

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

Practices for Lesson 19

Chapter 18 - Page 39

4. Use ODI Console to explore the ODI environment.

a. In the browser, open the new window, and then enter

http://localhost:8002/odiconsole to start the Oracle Data Integrator Console.To log in, enter SUPERVISOR for the user ID, and enter SUNOPSIS for the password.

Page 430: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 430/449

 

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

Practices for Lesson 19

Chapter 18 - Page 40

b. Click the Design Time tab. Expand Projects, Models, and Topology.

c. Select the Export-FF-RT project, and then click the View icon:

Page 431: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 431/449

 

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

Practices for Lesson 19

Chapter 18 - Page 41

d. Scroll down and click the First Folder link. Select the Interfaces tab. Explore theinterfaces created in your Export-FF-RT project.

Page 432: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 432/449

 

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

Practices for Lesson 19

Chapter 18 - Page 42

e. Click other tabs. Explore the different ODI objects in your project.

f. Similarly explore models in your Work repository. To explore the datastores, scrolldown and select Sub-Model Name. Scroll down and view the datastores.

Page 433: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 433/449

 

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

Practices for Lesson 19

Chapter 18 - Page 43

5. Stop WebLogic server.

a. To stop managed server odi_server_1, change directory to WLS Home -C:\Oracle\Middleware\user_projects\domains\ODI_DOMAIN\bin, and

then execute the command stopManagedWebLogic odi_server1. For the username, enter weblogic. For the password, enter welcome1.

b. To stop the WebLogic server, execute the command stopWebLogic.

Page 434: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 434/449

 

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

Practices for Lesson 19

Chapter 18 - Page 44

Page 435: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 435/449

 

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

Practices for Lesson 20

Chapter 19 - Page 1

Practices for Lesson 20

Chapter 19

Page 436: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 436/449

 

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

Practices for Lesson 20

Chapter 19 - Page 2

Practice 20-1: Executing an ODI Scenario Through the ODI Public WebService

Use Case Scenario: 

John created the procedure, which creates a relational table and populates it with data. Now,John needs to generate a scenario and create an ODI public Web service to execute thescenario.

Background: This practice has two aims: 1) To teach you how to execute a scenario throughthe ODI public Web service and 2) To become familiar with the use of theOdiInvokeWebService tool. Therefore, the OdiInvokeWebService tool will be used toinvoke the ODI public Web service that commands an agent to connect to a given Workrepository, and to start a specific scenario. In this practice, you use the interface created inPractice 10-1.

1. Create and execute a new scenario, INT_EXP_FF_RT.

2. Create a new package, OdiInvokeWebService.

3. Select the OdiInvokeWebService tool from the toolbox and create the correspondingstep in the package.

4. Define parameters of the Web service by using the Advanced dialog box and SOAP Editor.5. Invoke your Web service from the SOAP Editor to execute the scenario INT_EXP_FF_RT.

6. View the response and verify the execution results.

 Your Tasks:

1. If not connected, connect the Work repository, WORKREP. To connect, click Connect toRepository. Select DEV_ODI_REPO from the Login Name drop-down list. EnterSUPERVISOR in the User field and SUNOPSIS in the Password field. Click OK to log in.

Page 437: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 437/449

 

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

Practices for Lesson 20

Chapter 19 - Page 3

a. In the ODI Designer  tab, expand the project Export-FF-RT > First Folder >Interfaces. Right-click the interface INT_EXP_FF_RT, and then select Generate

Scenario. Name the new scenario: INT_EXP_FF_RT. Set the version to 001.

b. In the Topology Navigator, verify connection to your standalone agent localagent.

Note: Ensure that your standalone agent is created and successfully started. To createand start an ODI agent, refer to Practice 3-1.

Page 438: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 438/449

 

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

Practices for Lesson 20

Chapter 19 - Page 4

c. Expand the interface and execute a newly created scenario, as shown below. For Agent, select localagent. Click OK to confirm the execution.

Page 439: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 439/449

 

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

Practices for Lesson 20

Chapter 19 - Page 5

d. To view the results of the execution in Operator, click the Operator icon on theDesigner toolbar. Click Refresh. Expand the All Executions node. TheINT_EXP_FF_RT session should appear as complete.

Page 440: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 440/449

 

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

Practices for Lesson 20

Chapter 19 - Page 6

.

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

a. On the Projects tab, expand the project Procedure-CRT-TBL > First Folder >Packages. Right-click Packages and select New Package. EnterOdiInvokeWebService in the Name field, and then click the Diagram tab.

Page 441: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 441/449

 

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

Practices for Lesson 20

Chapter 19 - Page 7

b. Scroll down and select the OdiInvokeWebService tool from the toolbox. Click thediagram workbench. An OdiInvokeWebService tool step appears in the package.

Page 442: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 442/449

 

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

Practices for Lesson 20

Chapter 19 - Page 8

c. In the Properties panel, retain the default name OdiInvokeWebService 1 for the Stepname field. Scroll down, and define the 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 ISO8859_1

Page 443: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 443/449

 

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

Practices for Lesson 20

Chapter 19 - Page 9

Response File C:/TEMP/WebServiceToolStep

HTTP User - Leave blank - 

HTTP Password - Leave blank - 

Execution Timeout (ms) - Leave blank - 

d. Click the Advanced button. A new window opens. Enterhttp://localhost:20910/oraclediagent/OdiInvoke?wsdl for the Web

Service Description File (WSDL) URL field. Click the Connect to WSDL button .The appropriate port OdiInvokePortType is automatically detected and the availableoperations are displayed at the left.

e. Select the invokeStartScen operation in the left panel and then enter the parameters inthe request parameter fields as provided in the following table. Your SOAP Editor panelshould appear as follows.

Note: Press Enter each time to confirm your entries.

Parameter Value

<OdiUser> SUPERVISOR

Page 444: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 444/449

 

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

Practices for Lesson 20

Chapter 19 - Page 10

<OdiPassword> SUNOPSIS 

<WorkRepository> WORKREP

<ScenName> INT_EXP_FF_RT

<ScenVersion> 001

<Context> DEVELOPMENT

<LogLevel> 5

<SyncMode> True

f. 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 isnecessary to construct a valid query. The request should be as shown below.

Note: You can also select the Clean up before execution check box . This option

automatically deletes the empty optional elements in the SOAP request.

Page 445: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 445/449

 

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

Practices for Lesson 20

Chapter 19 - Page 11

3. Invoke your Web service.

a. To invoke your Web service, click the Invoke Web Service  icon. Click the SOAPEditor  tab. The response is displayed in the right panel of the SOAP Editor. Verify thatyour Web service processed successfully, as shown in the screen.

Page 446: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 446/449

 

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

Practices for Lesson 20

Chapter 19 - Page 12

Page 447: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 447/449

 

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

Practices for Lesson 20

Chapter 19 - Page 13

b. Click the Source tab again to view the scenario response. The response should be asshown in the following right panel. Click OK to close the window. Click the Save buttonto save your package and close the tab.

Page 448: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 448/449

 

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

Practices for Lesson 20

Chapter 19 - Page 14

c. In ODI Operator, verify that scenario INT_EXP_FF_RT successfully executed.

Page 449: D64974GC10_ag - Copy.pdf

8/21/2019 D64974GC10_ag - Copy.pdf

http://slidepdf.com/reader/full/d64974gc10ag-copypdf 449/449