oracle data integrator 11g - integration and administration activity guide volumen ii

Upload: danielhidalgop

Post on 27-Feb-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    1/270

    Oracle Data Integrator 11g:

    Integration and Administration

    Act ivity Guide - Volume II

    D64974GC20

    Edition 2.0

    September 2012

    D78957

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    2/270

    Copyrigh t 2012,Oracle and/or its affili ates. All rights reserved.

    Disclaimer

    This document contains proprietary information and is protected by copyright and

    other intellectual property laws. You may copy and print this document solely for your

    own use in an Oracle training course. The document may not be modified or altered

    in any way. Except where your use constitutes "fair use" under copyright law, you

    may not use, share, download, upload, copy, print, display, perform, reproduce,

    publish, license, post, transmit, or distribute this document in whole or in part without

    the express authorization of Oracle.

    The information contained in this document is subject to change without notice. If you

    find any problems in the document, please report them in writing to: Oracle University,

    500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not

    warranted to be error-free.

    Restricted Rights Notice

    If this documentation is delivered to the United States Government or anyone using

    the documentation on behalf of the United States Government, the following notice is

    applicable:

    U.S. GOVERNMENT RIGHTS

    The U.S. Governments rights to use, modify, reproduce, release, perform, display, or

    disclose these training materials are restricted by the terms of the applicable Oracle

    license agreement and/or the applicable U.S. Government contract.

    Trademark Notice

    Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names

    may be trademarks of their respective owners.

    uthor

    Richard Green

    Technical Contr ibutors

    and Reviewers

    Alex Kotopoulis

    Denis GrayChristophe Dupupet

    Julien Testut

    David Allan

    Sachin Thatte

    Viktor Tchemodanov

    Gerry Jurrens

    Veerabhadra Putrevu

    Editors

    Rashmi Rajagopal

    Vijayalakshmi Narasimhan

    Aju Kumar Kumar

    Graphic Designers

    Satish Bettegowda

    Seema Bopaiah

    Publishers

    Giri Venugopal

    Sumesh Koshy

    Srividya Rameshkumar

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    3/270

    Copyright 2012, 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 1: Introduction to Integration and Administration ................................................. 1-1

    Practices for Lesson 1: Overview ............ ............. ............. ............. ............ ............. ............. ............. ....... 1-2

    Practice 1-1: Starting the ODI Client ........................................................................................................ 1-3

    Practices for Lesson 2: Administering ODI Repositories ..................... ............. ............. ............ ............. 2-1

    Practices for Lesson 2: Overview ............ ............. ............. ............. ............ ............. ............. ............. ....... 2-2

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

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

    Practices for Lesson 3: ODI Topology Concepts ............ ............. ............. ............. ............. ............. ........ 3-1

    Practices for Lesson 3: Overview ............ ............. ............. ............. ............ ............. ............. ............. ....... 3-2

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

    Practices for Lesson 4: Describing the Physical and Logical Architecture ............................................ 4-1

    Practices for Lesson 4: Overview ............ ............. ............. ............. ............ ............. ............. ............. ....... 4-2

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

    Practices for Lesson 5: Setting Up a New ODI Project ................ ............. ............. ............. ............. ........ 5-1

    Practices for Lesson 5: Overview ............ ............. ............. ............. ............ ............. ............. ............. ....... 5-2

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

    Practices for Lesson 6: Oracle Data Integrator Model Concepts ............ ............. ............. ............. .......... 6-1

    Practices for Lesson 6: Overview ............ ............. ............. ............. ............ ............. ............. ............. ....... 6-2

    Practice 6-1: Creating a Model ................................................................................................................ 6-3

    Practices for Lesson 7: Organizing ODI Models and Creating ODI Datastores ....................................... 7-1

    Practices for Lesson 7: Overview ............ ............. ............. ............. ............ ............. ............. ............. ....... 7-2

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

    Practices for Lesson 8: ODI Interface Concepts ............. ............. ............. ............. ............. ............. ........ 8-1

    Practices for Lesson 8: Overview ............ ............. ............. ............. ............ ............. ............. ............. ....... 8-2

    Practice 8-1: Creating ODI Interface: Simple Transformations .................................................................. 8-3

    Practices for Lesson 9: Designing Interfaces ....................... ............. ............. ............. ............. ............. .. 9-1

    Practices for Lesson 9: Overview ............ ............. ............. ............. ............ ............. ............. ............. ....... 9-2

    Practice 9-1: Creating ODI Interface: Complex Transformations ............................................................... 9-3

    Practice 9-2: Creating ODI Interface: Implementing Lookup ............ ............. ............. ............. ............. ...... 9-22

    Practices for Lesson 10: Interfaces: Monitoring and Debugging .................... ............. ............ ............. .. 10-1

    Practices for Lesson 10: Overview ........................................................................................................... 10-2

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

    Practices for Lesson 11: Designing Interfaces: Advanced Topics 1 ............. ............. ............ ............. .... 11-1

    Practices for Lesson 11: Overview ........................................................................................................... 11-2

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

    Practice 11-2: Using Temporary Indexes ................................................................................................. 11-18

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2 ............. ............. ............ ............. .... 12-1

    Practices for Lesson 12: Overview ........................................................................................................... 12-2

    Practice 12-1: Using Temporary ODI Interfaces ....................................................................................... 12-3

    Practice 12-2: Developing a New Knowledge Module ............................................................................... 12-38

    Practices for Lesson 13: Using ODI Procedures ............. ............. ............. ............. ............. ............. ........ 13-1

    Practices for Lesson 13: Overview ........................................................................................................... 13-2

    Practice 13-1: Creating an ODI Procedure ............................................................................................... 13-3

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    4/270

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

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

    ii

    Practices for Lesson 14: Using ODI Packages ........... ............. ............. ............. ............. ............. ............. 14-1

    Practices for Lesson 14: Overview ........................................................................................................... 14-2

    Practice 14-1: Creating an ODI Package ............ ............ ............. ............. ............. ............. ............. ......... 14-3

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

    Practices for Lesson 15: Managing ODI Scenarios ............. ............. ............. ............. ............. ............. .... 15-1

    Practices for Lesson 15: Overview ........................................................................................................... 15-2

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

    Practices for Lesson 16: Using Load Plans ............. ............. ............. ............. ............. ............. ............. .. 16-1

    Practices for Lesson 16: Overview ........................................................................................................... 16-2

    Practice 16-1: Using Load Plans .............................................................................................................. 16-3

    Practices for Lesson 17: Managing ODI Versions ............. ............. ............. ............. ............. ............. ...... 17-1

    Practices for Lesson 17: Overview ........................................................................................................... 17-2

    Practice 17-1: Working with ODI Versions ................................................................................................ 17-3

    Practices for Lesson 18: Enforcing Data Quality with ODI ............ ............. ............. ............. ............. ...... 18-1

    Practices for Lesson 18: Overview ........................................................................................................... 18-2

    Practice 18-1: Enforcing Data Quality with ODI Interface .......................................................................... 18-3

    Practices for Lesson 19: Working with Changed Data Capture ............ ............. ............. ............. ............ 19-1

    Practices for Lesson 19: Overview ........................................................................................................... 19-2Practice 19-1: Implementing Changed Data Capture ................................................................................ 19-3

    Practices for Lesson 20: Advanced ODI Administration ............ ............. ............. ............. ............. .......... 20-1

    Practices for Lesson 20: Overview ........................................................................................................... 20-2

    Practice 20-1: Setting Up ODI Security .................................................................................................... 20-3

    Practice 20-2: Integration with Enterprise Manager and Using ODI Console ............ ............. ............. ........ 20-22

    Practices for Lesson 21: Extending Oracle Data Integrator with SDK, Web Services, and SOA ............ 21-1

    Practices for Lesson 21: Overview ........................................................................................................... 21-2

    Practice 21-1: Executing an ODI Scenario Through the ODI Public Web Service....................... ............. ... 21-3

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    5/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 1

    Practices for Lesson 12:Designing Interfaces:Advanced Topics 2

    Chapter 12

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    6/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 2

    Practices for Lesson 12: Overview

    Practices Overview

    In Practice 12-1, you use a temporary ODI interface for data transformation. In Practice 12-2,you duplicate an existing knowledge module and modify the duplicate knowledge module to usewith an interface.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    7/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 3

    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 a

    bulk feed of customer data from another system.Now, John needs to create a temporary interface, which is used for loading data to a salestarget datastore.

    Background:

    In this practice, you perform the following steps:

    1. Create a temporary interface, INT_12-1.

    Use datastores SRC_ORDERSand SRC_ORDER_LINESfrom the HSQL_SRCmodel,joined on ORDER_ID.

    Use SRC_CUSTOMERas 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-1as a source.

    Use the datastore TRG_SALESas the target.

    3. Execute INT_12-1-2and examine the rows inserted into TRG_SALES.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    8/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 4

    Your Tasks:

    1. Develop an ODI Temporary interface.

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

    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 Mappingtab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    9/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 5

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

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    10/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 6

    d. Drag the ORDER_IDcolumn from the SRC_ORDERSdatastore to theSRC_ORDER_LINESdatastore to create a Join.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    11/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 7

    e. Click the Lookupicon 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.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    12/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 8

    f. Select the CUST_IDcolumn in the Source table and the CUSTIDcolumn in the Lookuptable, as shown in the screen, and then click Join. Click Finish.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    13/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 9

    g. Now, you need to create a temporary target datastore. Drag the column CUST_IDfromthe SRC_ORDERStable to the Targetarea. Click . Inthe Temporary Target Properties, enter Name: TEMP_AGG_ORDERS, as shown inthe following screen:

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    14/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 10

    h. Drag the column ORDER_IDfrom SRC_ORDERSto the Targetarea. Then click thisSRC_ORDERScolumn in the target data store. In the Mapping Properties panel at thebottom of the window, edit the Implementation tab to read:MIN(SRC_ORDERS.ORDER_ID). Scroll down to the Target Column Properties sectionand rename this column to FIRST_ORDER_ID. Scroll back up the Property Inspectorand examine your results thus far.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    15/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 11

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    16/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 12

    i. Again, drag the column Order_IDfrom SRC_ORDERSto the Target area. In theMapping Properties panel at the bottom of the window, edit the Implementation tab toread: MAX(SRC_ORDERS.ORDER_ID). Scroll down and rename this columnLAST_ORDER_ID.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    17/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 13

    j. Drag the column ORDER_DATEfrom SRC_ORDERSto the Target area. In theMapping Properties panel at the bottom of the window, edit the Implementation tab toread: MIN(SRC_ORDERS.ORDER_DATE). Scroll down and rename this columnFIRST_ORDER_DATE.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    18/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 14

    k. Similarly, drag the column ORDER_DATEagain from SRC_ORDERSto the Targetarea. Edit the mapping properties to read MAX(SRC_ORDERS. ORDER_DATE). Scrolldown and rename this column LAST_ORDER_DATE.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    19/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 15

    l. In the Source area, expand the lookup datastore by clicking the plus sign in the upperleft corner of the lookup datastore, and then stretching the datastore longer until yousee all of its columns. Drag the FIRST_NAMEcolumn from the lookup table to theTarget area. In the Target area, click the FIRST_NAMEcolumn. Start the Expression

    editor , and then drag the LAST_NAMEcolumn from the left panel of theExpression Editor to the expression area.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    20/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 16

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    21/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 17

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    22/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 18

    m. Edit the expression to read LKUP_SRC_CUSTOMER.FIRST_NAME || ||

    LKUP_SRC_CUSTOMER.LAST_NAME, as shown next. Click OK. Click the button tovalidate the expression. An ODI Information message indicates that the SQLexpression is valid. Click OK.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    23/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 19

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

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    24/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 20

    o. Drag the column QTYfrom the SRC_ORDER_LINESsource datastore to the Targetarea. Edit the mapping expression to read SUM(SRC_ORDER_LINES.QTY).

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    25/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 21

    p. Drag the column AMOUNTfrom the SRC_ORDER_LINESsource datastore to theTarget area. Edit the mapping expression to readAVG(SRC_ORDER_LINES.AMOUNT).In the Target Column Properties, rename this columnAVG_AMOUNT.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    26/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 22

    q. Drag the column AMOUNTagain from the SRC_ORDER_LINESsource datastore tothe Target area. Edit the mapping expression to readSUM(SRC_ORDER_LINES.AMOUNT). Rename this column SUM_AMOUNT.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    27/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 23

    r. Drag the column PRODUCT_IDfrom the SRC_ORDER_LINESsource datastore tothe Target area.

    s. In the Target datastore, click the SUM_AMOUNTcolumn. In the Execute onsection,select Staging Area. Repeat this step for the six other target columns in which youdefined a function in the mapping expression. Refer to the following table to verify the

    execution location. Your Target datastore should now look as shown in the screen.Click the Flowtab.

    Column Execution Location

    SUM_AMOUNT Staging Area

    AVG_AMOUNT Staging Area

    CUST_ID Source

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    28/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 24

    CUST_NAME Source

    FIRST_ORDER_DATE Staging Area

    FIRST_ORDER_ID Staging Area

    LAST_ORDER_DATE Staging Area

    LAST_ORDER_ID Staging Area

    PRODUCT_ID Source

    QTY Staging Area

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    29/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 25

    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 yellow color of your newly created temporary interface in the DesignerNavigators Projects tree view.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    30/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 26

    2. Create a new interface, which uses the newly created temporary interface as a source.

    a. In the HandsOnLoads project, create a new ODI interface, INT_12-1-2, as shownnext. In the Optimization Context field, select Development. Open the Mappingtab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    31/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 27

    b. Drag the temporary interface, INT_12-1, from the Projectstab to the Source area.

    c. From the Models tab, drag the datastore TRG_SALESfrom the Oracle SalesApplicationmodel to the Target Datastore area. ClickYesto perform automaticmapping. Note that only three of the nine columns were automatically mapped.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    32/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 28

    d. In the Target Datastore, select the FIRST_ORD_DATEcolumn. Drag theFIRST_ORDER_DATEcolumn from the temporary interface in the source area to theImplementation tab in the Mapping Properties area.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    33/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 29

    e. Repeat the previous two-step process to map the remaining target columns to theircorresponding columns in the temporary interface in the Source area. Use the followingtable and results screen as your guide:

    1. First click this column in the TargetDatastore TRG_SALES:

    2. Then drag this column from the Sourcearea down to the Implementation tab:

    FIRST_ORD_ID FIRST_ORDER_ID

    LAST_ORD_ID LAST_ORDER_ID

    LAST_ORD_DATE LAST_ORDER_DATE

    AMOUNT SUM_AMOUNT

    PROD_AVG_PRICE AVG_AMOUNT

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    34/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 30

    f. In the Source panel, click INT_12-1 (TEMP_AGG_ORDERS), scroll down to theSource Propertiessection, and then select the Use Temporary Interface as DerivedTable (Sub-Select)check box.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    35/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 31

    g. To view data derived from the temporary interface, right-click the temporary interfaceand select Data. Close the Data Editor window.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    36/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 32

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    37/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 33

    h. Select the Flowtab, click Target datastore, and verify the flow of your interface. In theTarget Properties, set the DELETE_ALLoption to true. Save the interface, and thenclose the interface tab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    38/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 34

    3. Execute the interface INT_12-1-2 and verify the execution results.

    a. Execute the interface INT_12-1-2.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    39/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 35

    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 new rows.Verify the number of inserts.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    40/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 36

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

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    41/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 37

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    42/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 38

    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, by using command syntaxprovided in text files.

    Next, you duplicate an existing interface, INT-Exp-FF-RT, naming the new interface INT-EXP-FF-RT-AUDIT. You change the new interfaces IKM selection to use the new knowledge moduleyou 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.

    Your Tasks:

    1. Create the new knowledge module with new functionality to create an audit table and insertaudit records.

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

    21

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    43/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 39

    b. Open ODI Designer and click the Projects tab. Select Projects > Export-FF-RT >Knowledge Modules > Integration (IKM). Right-click IKM SQL Incremental Updateand select Duplicate Selection. In the window that follows, clickYes.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    44/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 40

    c. Double-click Copy of IKM SQL Incremental Updateto edit it. Rename this KM IKMOracle UI Audit. Click the Detailstab.

    Note:If the message for Object Locking/Unlocking is displayed, click OK.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    45/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 41

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

    rowsand then click the Add icon to add the new command.

    e. Name this command Create Audit Table. Select the Ignore Errorscheck box. Inthe Command on Target tab, set the Technologyto Oracle. Enter the followingcommand to create the audit table. Verify that the check boxes in the Journalizingsection are not selected. If necessary, deselect them.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    46/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 42

    Note:You can find this command in the file 12-2.txt, provided in the followinglocation: c:\Labs\Text.

    create table _H

    (

    ,

    AUDIT_DATE DATE,

    AUDIT_INDICATOR VARCHAR2(1)

    )

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    47/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 43

    f. Click the Detailstab. Scroll down and select the Create Audit Tablecommand. Click

    the icon several times to move the command up and place it right after the Insertnew rowsstep, as shown below. Verify that the Ignore Errorscheck box is selectedfor your new Create Audit Tablecommand.

    With the Create Audit Tablecommand still selected, click the Addicon again.

    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 Errorscheck box. In the Command on Target tab, set the Technologyto Oracle. Enter thecommand provided below.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    48/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 44

    Note:You can find this command in the file 12-2.txt, provided in the followinglocation: c:\Labs\Text.

    Insert into _H

    (

    ,

    AUDIT_DATE,

    AUDIT_INDICATOR

    )

    select ,

    sysdate,

    IND_UPDATE

    from

    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 (theData schema [D] or the Staging schema [W]).

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    49/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 45

    getColList:

    Notice the PK parameter. If it is used, only the columns that are part of theprimary key are included.

    `

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    50/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 46

    g. Click the Detailstab. Scroll down and select the Insert Audit Recordscommand.

    Click the icon several times to move the command up and place it right after theCreate Audit Tablestep, as shown in the next screen. Click Save, and then closethe tab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    51/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 47

    h. After clicking Save, verify that your new knowledge module, IKM Oracle UI Audit,appears in the Knowledge Modules tree.

    2. You will create a modified copy of the interface INT-EXP-FF-RT, to execute with your newlycreated knowledge module. You will need to duplicate the existing interface, rename it, andthen change the IKM entry to use your new IKM Oracle UI-Audit.

    a. On the Projects tab, right-click the interface INT-EXP-FF-RT and select DuplicateSelection. ClickYeson the Confirmation screen.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    52/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 48

    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 screenshot. Click the Flowtab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    53/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 49

    c. On the Flow tab, click Target (ODI_STAGE)in the diagram to open the Target Area Property Inspector below the diagram. In the IKM Selector drop box, select IKM OracleUI - Audit. Ensure that in the Options list, FLOW_CONTROL and STATIC_CONTROLoptions are set to false, as shown in the screenshot. Click the Savebutton, and thenclose the tab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    54/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 50

    To execute your new interface, select the interface and click the Executebutton .Click OK. Click OKagain in the Information window to start the execution.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    55/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 51

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

    necessary, click the Refreshicon , find your new interface session, and view thesession steps.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    56/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 52

    e. Scroll down and double-click the Create Audit Tablestep. View the content of theDefinition and Code tabs for this step. Close the tab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    57/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 53

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

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    58/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 54

    g. Open Oracle SQL Developer and expand the ODI_STAGE connection (for thepassword, enter ODI_STAGE). Select the Tables(Filtered) node and if necessary click

    the Refreshbutton . Click the Audit table TRG_SALES_PERSON_H, click theDatatab, and verify that your Audit table was created and populated with audit records,as shown next.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    59/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 55

    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 Projectstab, right-click IKM Oracle UI Audit, and select NewOption. Name this option AUDIT_CHANGES, set Type to Check Box, and DefaultValue to true. Click Saveand close the AUDIT_CHANGES option tab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    60/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 56

    b. Now, you need to link this option to your steps in the KM. Double-click IKM Oracle UI -Audit, and click the Detailstab. Double-click your new step, Create Audit Table, toedit it. Scroll to the bottom and click the Options plus sign [+]to show its contents.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    61/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 57

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    62/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 58

    c. Deselect the Always Executecheck box. Select AUDIT_CHANGES. This willcondition the execution of these steps with the value set by the end user. Click Save.Click the Detailstab.

    d. Repeat the previous step for the Insert Audit Records command, as shown in thefollowing screens. Click Saveto save your KM and close the tab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    63/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 59

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    64/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 60

    e. Double-click INT-Exp-FF-RT-Auditto edit it. Click the Flowtab, click Target(ODI_STAGE), and verify that the option AUDIT_CHANGES is set to true.

    Execute the interface .

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    65/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 61

    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 AuditRecords steps should be present.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    66/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 62

    g. In Designer, edit the INT-Exp-FF-RT-Audit interface again. In the Flowtab, clickTarget (ODI_STAGE)and set the option AUDIT_CHANGES to false. Save your

    interface and then execute your interface again .

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    67/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 63

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    68/270

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

    Practices for Lesson 12: Designing Interfaces: Advanced Topics 2

    Chapter 12 - Page 64

    h. In ODI Operator, click the Refreshbutton and view the execution results. The new KMsteps to create and populate an audit table are not executed.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    69/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 1

    Practices for Lesson 13:Using ODI Procedures

    Chapter 13

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    70/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 2

    Practices for Lesson 13: Overview

    Practices Overview

    In this practice, you define an ODI procedure to create a relational table and populate it withdata.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    71/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 3

    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 creating and populating 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 schemaall named ODI_STAGEwhich you created in Practice 10-1.

    You create the project Procedure-CRT-TBL, and you create the procedure PRD-create-populate-table.

    Next, you add commands to drop, create, and populate a table, by using the syntax provided in

    text files.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.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    72/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 4

    Your Tasks:

    1. Create the new project in ODI Designer.

    a. Switch to the Designer Navigator. Click the Designertab. Select the Projectstab, click

    the New Project icon, and select New Project.

    b. Enter the nameof the project: Procedure-CRT-TBL. Click the Savebutton to createthe project and close the tab. The project appears in the tree view. Expand theProcedure-CRT-TBL project node.

    Note:In this practice, you use the same RDBMS schema, ODI data server, and physicalschema named ODI_STAGE that you created in Practice10-1. If you have not performedPractice 10-1, complete Practice 10-1, steps 5 and 7 to create the RDBMS schema, theODI source data server, and the physical schema for your new RDBMS model.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    73/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 5

    c. Open the ODI Topology Navigator, select Physical Architecture. ExpandTechnologies > Oracle > ODI _STAGE. Verify that you have the physical schemaODI_STAGE created under ODI_STAGE data server.

    d. Open ODI Designer. In the Projects tab, select Procedure-CRT-TBL > First Folder.Right-click Proceduresand select New Procedure.

    e. Enter the procedure name as PRD-create-populate-table. Set Target

    Technology to Oracle. Click the Detailstab. Click the icon to add a step in theprocedure.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    74/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 6

    f. In the command window, enter the parameters of the procedure and the command onthe target provided in the following table. You need this command to drop the table incase a table with this name exists. Select the Ignore Errorscheck box.

    Parameter Value

    Name Drop Table

    Technology Oracle

    Schema ODI_STAGE

    Ignore Errors Selected

    DROP table ODI_STAGE.SRC_SALES_PERSON

    g. Click the Detailstab, and then click the icon to add another step in the procedure.In the command screen, if not selected, click the Command on Targettab. Enter theparameters of the procedure and the command provided below.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    75/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 7

    Note:You can copy this command from the 13-1.txtfile, which is provided in yourLabfolder in the following location: c:\Labs\Text.

    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" primarykey("SALES_PERSON_ID")

    )

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    76/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 8

    h. Click the Detailstab. Click the icon to enter the step to populate theSRC_SALES_PERSONtable.

    i. In the command screen, click the Command on Targettab. Enter the parameters andthe command shown below. Click the Detailstab 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

    Schema ODI_STAGE

    Ignore Errors Deselected

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    77/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 9

    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;

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    78/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 10

    j. Select the Detailstab and note the three steps. Click Saveand close the tab.

    2. Execute your newly created procedure and verify the results.

    a. Expand Procedure-CRT-TBL > Procedures, select the newly created procedurePRD-create-populate-table, and then click the Executionbutton to run the procedure

    . Click OK. Click OKagain.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    79/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 11

    b. Open ODI Operator. In ODI Operator, click the All Executionsnode, click the Refresh

    icon, find your session, and verify that your procedure executed successfully.

    c. Open Oracle SQL Developer and expand the ODI_STAGE connection. Select the

    Tables node and click the Refreshbutton . Double-click the newly created tableSRC_SALES_PERSON, click the Datatab, and verify that your tableSRC_SALES_PERSON was successfully created and populated with records asshown in the following screenshot.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    80/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 12

    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 Typeto Value. Add the description as shown onthe screen. Set the default value of this option toY(no quotes). Click the Saveicon.

    4. Open your procedure, PRD-create-populate-table, and then click the Detailstab. Click theAddicon to add a new command.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    81/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 13

    5. 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.

    Parameter Value

    Name DELETE AUDIT RECORDS

    Technology Oracle

    Schema ODI_STAGE

    Ignore Errors Checked

    6. Click the Options tab and verify that the value of your newly created option is set to Y.Click the Saveicon.Note:To view the inputs in the Options tab, you must click the Refreshbutton.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    82/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 14

    7. Execute your procedure. In Operator, verify that the procedure executed successfully.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    83/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 15

    8. Open SQL Developer and expand ODI_STAGE > Tables(Filtered). Open the Audit tableTRG_SALES_PERSON_H, click the Datatab, and verify that the rows were deleted fromthe Audit table.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    84/270

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

    Practices for Lesson 13: Using ODI Procedures

    Chapter 13 - Page 16

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    85/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 1

    Practices for Lesson 14:Using ODI Packages

    Chapter 14

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    86/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 2

    Practices for Lesson 14: Overview

    Practices Overview

    In Practice 14-1, you create an ODI procedure and package to execute the sequence oftransformations for the Interfaces created in previous practices. In Practice 14-2, you modify apackage to use it with a variable and a user function that you define.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    87/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 3

    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 creating a package that executes a number ofobjects (Interfaces, Procedures) in the flow. In this practice, you create an ODI procedure andpackage to execute the sequence of transformations with the interfaces created in the previouspractices.

    In this practice, you create a procedure, DELETE_TARGET, for deleting records from theTRG_SALES, TRG_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.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    88/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 4

    Your Tasks:

    1. Create a DELETE_TARGETprocedure that deletes the data in the TRG_SALES,TRG_CUSTOMER,TRG_CITY,TRG_REGION, andTRG_COUNTRYtables in theORACLE_LOCAL_SALESlogical schema.

    a. If not open, log in to DEV_ODI_REPO and enter SUPERVISORfor the username andSUNOPSISfor the password.

    b. In the Designer tab, click the Projectstab, and then select the Proceduresnode fromthe HandsOnLoads > HandsOnfolder. Right-click the Proceduresnode and select theNew Procedureoption.

    c. Enter DELETE_TARGETin the Name field, and select Oracleas the Target

    Technology. Click the Detailstab, and then click the Addicon .

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    89/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 5

    d. In the Name Field, enter DELETE TRG_SALES. In the Schema field, select

    ORACLE_ORCL_LOCAL_SALES. In the Context field, select Development. In theCommand field, enter the following code:

    DELETE FROM

    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 Errorscheck box. Select the Detailstab.

    e. Click the Addicon. In the Name Field, enter DELETE TRG_CUSTOMER. In the Schemafield, select ORACLE_ORCL_LOCAL_SALES. In the Context field, selectDevelopment.

    In the Command field, enter the following code:

    DELETE FROM

    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 Errorscheck box. Select the Detailstab

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    90/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 6

    f. Repeat the two previous steps to create the commands DELETE TRG_CITY, DELETETRG_REGION, and DELETE TRG_COUNTRY, which delete the tablesTRG_CITY,

    TRG_REGION, andTRG_COUNTRY, respectively, as shown in the following screen.Note:To enter the commands, you may refer to the file 14-1.txtprovided at thefollowing location: c:\Labs\Text.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    91/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 7

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    92/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 8

    g. Open the Details tab to view the commands. Click the Savebutton, and then close theprocedure tab.

    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. In the Projects tab of the Designer Navigator, expand the HandsOnLoads > HandsOnfolder. Right-click the Packagesnode and select the New Packageoption.

    b. Enter PKG_14-1in the Name field, and then click the Diagramtab. In the Designernavigator tree view, expand the Interfaces node and Procedures node. Select theDELETE_TARGETprocedure from the tree view, and then drag it to the diagramworkbench. A DELETE_TARGET step appears in the package.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    93/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 9

    c. Repeat the operation for the INT_8-1, INT_8-2, INT_8-3, and INT_9-1 interfaces. The

    package should appear as follows.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    94/270

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    95/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 11

    f. Click the Step After Successtool icon on the Package toolbar. Click the DeleteTarget Tablesstep. Press and hold the left mouse button and move the cursor overthe Countries step. Then release the mouse button. A green arrow appears betweenthese steps.

    g. Click the Countries step. Press and hold the left mouse button and move the cursorover 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 > Regions > Cities > Customers, as follows.

    h. Click the Savebutton to save this package.

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

    a. Click the Executepackage button to run this package. Click OKin the Executionwindow that appears, and then click OKagain.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    96/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 12

    b. In the Operator Navigator, click the Refreshicon. In the session list, expand the AllExecutions node. The session called PKG_14-1 should appear as complete. You canexpand the nodes in the session to see the steps and tasks corresponding to yourprocedure commands and the interfaces that have been executed.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    97/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 13

    c. Close the PKG_14-1 tab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    98/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 14

    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 to

    create a variable DELETION_FLAGfor counting the number of lines in TRG_CUSTOMERand to

    have the Delete Target step running only if DELETION_FLAGis 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 HandsOnLoadsproject, define a user function group named Conversion,containing a user function named DearConvert.

    2. Use this function in the interface INT_9-1to convert the values (0, 1, 2) to (Mr, Mrs,Ms).

    3. In ODI Designer, create a numeric variable DELETION_FLAGthat counts the number of

    lines in TRG_CUSTOMER.4. Duplicate the PKG_14-1package, naming the new package PKG_14-2.

    5. Have the DELETE_TARGETprocedure run only if the DELETION_FLAGvariable is greaterthan 0.

    Your Tasks:

    1. Create a user function called DearConvertin a new user function group calledConversion. This function converts the values (0, 1, 2) to (Mr, Mrs, Ms). Implementthis function for Oracle as linked technology with a CASEWHENexpression.

    Note:Remember to use the dollar sign ($) when using the parameters.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    99/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 15

    a. Select the User Functionsnode in the HandsOnLoads project. Right-click this nodeand select New User Function.

    b. Enter DearConvertin 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:$1is the parameter name you use in the decision case structure shown in thefollowing screenshot.

    Click the Implementations tab, and then click the Add button.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    100/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 16

    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 OKto save this implementation. Click theSaveicon, and then close the DearConvert user function tab.

    Note

    In Locking/Unlocking Object windows that may appear, clickYes.

    To enter the commands, you may refer to the file 14-2.txtprovided 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

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    101/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 17

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    102/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 18

    2. You use this function in the interface INT_9-1 to convert the source DEARcolumn into thetarget DEARcolumn.

    a. In the Projects tree view, expand Interfaces. Double-click the interface INT_9-1to openit. In the Locking window, clickYes. Click the Mappingtab.

    b. In the Target datastore, select the Dearcolumn. Edit the implementation in theProperties panel to have the following code:

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    103/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 19

    DearConvert(SRC_CUSTOMER.DEAR). Scroll down to select the Staging Areaoption from the Execute onpanel. Click the Savebutton to save the interface.

    3. Run the INT_9-1 interface and review the conversion result.

    a. In the interface window, click the Executebutton. In the Execution window, selectDevelopmentcontext, and then click OK. Click OKwhen the Session startedmessage appears. Close the INT_9-1 editing tab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    104/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 20

    b. Click the Operatortab. Select All Executions, and then click Refresh. Expand the AllExecutions node. The session called INT_9-1 should appear as complete. Note thatthe steps you see may not be identical to those shown below.

    c. In the Mapping tab, right-click the Targetdatastore and select Data. Verify that thecolumn DEAR was populated with Mr as shown below.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    105/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 21

    4. Create a numeric variable called DELETION_FLAGthat counts the number of lines inTRG_CUSTOMER.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    106/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 22

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

    b. Enter DELETION_FLAGin the Name field, select Numericas the Datatype, and enter

    0in the Default Value field. In the Keep History field, select All Valuesto enableviewing the history of all values for this variable.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    107/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 23

    c. Click the Refreshing tab. Select ORACLE_ORCL_LOCAL_SALESas the schema, and inthe Select Query field, enter the following expression. Click the Savebutton to save thevariable. Close the DELETION_FLAG variable tab.

    Note:To enter commands, refer to the file 14-2.txtprovided at the followinglocation: c:\Labs\Text.

    SELECT COUNT(*) FROM

    5. Modify a package to have the Delete Target step running only if DELETION_FLAGisgreater than 0.

    a. Duplicate the PKG_14-1 package. Open the package Copy of PKG_14-1 and renameit PKG_14-2.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    108/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 24

    b. Select the Diagramtab. In the project tree, expand the Variables node. Drag theDELETION_FLAGvariable from the tree view to the diagram. Click theDeletion_FLAGstep in the diagram. In the Properties > General tab beneath thediagram, rename this step Refresh Customer Count. Ensure that the Type field isset to the Refresh variable.

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

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    109/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 25

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    110/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 26

    c. Drag the DELETION_FLAGvariable from the tree view to the diagram again. Renamethis step Flag > 0?, change the Typeto Evaluate Variable. In the Operatorfield,select > as theoperator,and enter 0in the Valuefield.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    111/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 27

    d. Right-click the Refresh Customer Countstep and select First Step. Click the

    Next step on success tool on the Package toolbar, and link the step RefreshCustomerCountto 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 Countriesstep, as shownbelow. Click Saveto save the package. Close the tab.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    112/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 28

    6. Run the new package and check if the Delete Target Tablesstep was executed.

    a. Right-click the package PKG_14-2, and then select Execute. Click OKin theExecution window, and then click OKwhen the Session started message appears.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    113/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 29

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

    c. Open the Designer tab. Open the package PKG_14-2 again, and then select theDiagramtab. To delete records from the target tables, select the Delete Target Tablesstep, right-click, and select Execute Step. Click OKin the Execution window, and thenclick OKwhen the Session started message appears.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    114/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 30

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

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    115/270

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

    Practices for Lesson 14: Using ODI Packages

    Chapter 14 - Page 31

    e. Now, with records from the target tables having been deleted, execute the entirepackage PKG_14-2 again. Click OK in the Execution window, and then click OKwhenthe Session started message appears.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    116/270

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    117/270

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

    Practices for Lesson 15: Managing ODI Scenarios

    Chapter 15 - Page 1

    Practices for Lesson 15:Managing ODI Scenarios

    Chapter 15

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    118/270

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

    Practices for Lesson 15: Managing ODI Scenarios

    Chapter 15 - Page 2

    Practices for Lesson 15: Overview

    Practices Overview

    In this practice, you create an ODI scenario and schedule its execution with an ODI agent inscheduling mode.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    119/270

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

    Practices for Lesson 15: Managing ODI Scenarios

    Chapter 15 - Page 3

    Practice 15-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 Navigators 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 thescenario 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 SUPERVISORin the User field andSUNOPSISin the Password field. Click OKto log in.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    120/270

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

    Practices for Lesson 15: Managing ODI Scenarios

    Chapter 15 - Page 4

    b. In ODI Designer, click the Projectstab. On the Projects tab, expand the project:Procedure-CRT-TBL > First Folder > Procedures. Right-click the PRD-create-populate-tableprocedure and select Generate Scenario.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    121/270

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

    Practices for Lesson 15: Managing ODI Scenarios

    Chapter 15 - Page 5

    c. Accept the default scenario name PRD_CREATE_POPULATE_TABLE. The version isset to 001. Click OK.

    d. Expand the PRD-create-populate-table procedure and expand Scenarios. Right-clickthe PRD_CREATE_POPULATE_TABLEscenario to view the possible options, asshown in the following screenshot.

    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.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    122/270

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

    Practices for Lesson 15: Managing ODI Scenarios

    Chapter 15 - Page 6

    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.

    b. Expand the PRD-create-populate-tableprocedure. Expand Scenarios >PRD_CREATE_POPULATE_TABLE Version 001. Right-click Schedulingand selectNew Scheduling.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    123/270

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

    Practices for Lesson 15: Managing ODI Scenarios

    Chapter 15 - Page 7

    Note:To schedule a scenario, an ODI Agent must be set up. If an ODI Agent is not setup within the ODI Topology Navigator, perform Practice 3-1, Setting Up and Installingan ODI Agent.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    124/270

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

    Practices for Lesson 15: Managing ODI Scenarios

    Chapter 15 - Page 8

    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 screenshot. Click the Savebutton.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    125/270

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

    Practices for Lesson 15: Managing ODI Scenarios

    Chapter 15 - Page 9

    d. Expand Scheduling and verify that the DEVELOPMENT / localagent entry is nowinserted under Scheduling.

    e. Open Topology Navigator to review the scheduling of the Agent. In the Physicalarchitecture, expand the Agentsnode and double-click localagent. On the localagentscreen, click Update Schedule. On the screen that follows, click OK. Click OKagain.

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    126/270

  • 7/25/2019 Oracle Data Integrator 11g - Integration and Administration Activity Guide Volumen II

    127/270

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

    Practices for Lesson 15: Managing ODI Scenarios