23
Oracle Technology Network Creating an ODI Project and Interface: Exporting a Flat File to a Flat File Note: Instructions and any text that you need to modify are enclosed in <>. This tutorial contains the following sections: Purpose Time to Complete Overview Scenario Software and Hardware Requirements (Optional) Prerequisites Creating a New Project with Oracle Data Integrator Creating a New Physical Schema for the Flat File Model Creating a New ODI Model for the Flat File Source Creating a New ODI Source Datastore for use with ODI Interface Creating a New ODI Target Datastore for use with ODI Interface Creating a New ODI Interface for Flat File to Flat File Transformations Summary Resources Purpose This tutorial walks you through the steps that are needed to create a project and an interface in Oracle Data Integrator (ODI) to export a flat file to another flat file. Time to Complete Approximately 40 minutes Overview A common task that is performed using ODI is to export data from a flat file and load this data into another flat file. This tutorial walks you through the steps that are needed to create a project and an interface that will import a file to a staging area, perform some minor transformations, and then write the data to a file. You also execute the interface and verify the execution using ODI Operator. Scenario Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for performing database management and integration tasks on various resources within the organization. In particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects, Linda created the new Master repository and Work repository. Now Linda needs to create a project and an interface to export data from a flat file, perform transformations, and load this data into another flat file. Software and Hardware Requirements (Optional) The following is a list of software requirements: The system should include the following installed products: Oracle Database 11g Oracle Data Integrator 11gR1 If not done before, start the services and components for Oracle Database 11g Prerequisites Before you start the tasks, make sure that your system environment meets the following requirements: 1. Have installed Oracle Database 11g. If not done before, start the services and components for Oracle Database 11g 2. Have installed Oracle Data Integrator 11gR1 3. Before attempting this OBE, you should have successfully completed the following OBE: Creating and Connecting to ODI Master and Work Repositories. To access this OBE, click HERE. Creating a New Project with Oracle Data Integrator To create a new project within Oracle Data Integrator, perform the following steps: Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-... 1 of 23 3/23/2012 6:42 PM

Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

Embed Size (px)

Citation preview

Page 1: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

Oracle Technology Network

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

Note: Instructions and any text that you need to modify are enclosed in <>.

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Scenario

Software and Hardware Requirements (Optional)

Prerequisites

Creating a New Project with Oracle Data Integrator

Creating a New Physical Schema for the Flat File Model

Creating a New ODI Model for the Flat File Source

Creating a New ODI Source Datastore for use with ODI Interface

Creating a New ODI Target Datastore for use with ODI Interface

Creating a New ODI Interface for Flat File to Flat File Transformations

Summary

Resources

Purpose

This tutorial walks you through the steps that are needed to create a project and an interface in Oracle Data Integrator (ODI) to export a flat file toanother flat file.

Time to Complete

Approximately 40 minutes

Overview

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

Scenario

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

Software and Hardware Requirements (Optional)

The following is a list of software requirements:

The system should include the following installed products:Oracle Database 11gOracle Data Integrator 11gR1

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

Prerequisites

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

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

2 . Have installed Oracle Data Integrator 11gR1

3 . Before attempting this OBE, you should have successfully completed the following OBE: Creating and Connecting toODI Master and Work Repositories. To access this OBE, click HERE.

Creating a New Project with Oracle Data Integrator

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

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

1 of 23 3/23/2012 6:42 PM

Page 2: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

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

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

3. On the screen that appears, set the Name of the project to ODIexp_RT_RT in the Name field. The Code field is filled automatically. Click Save iconcreated ODIexp_RT_RT project now appears in the Projects tree view. You have now successfully added a new ODI project.

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

2 of 23 3/23/2012 6:42 PM

Page 3: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

4.

For this interface, Linda has to import a flat file into the SQL staging area, and then export the file to a different flat file. The Knowledge Modules (KMs)required for this are LKM File to SQL and IKM SQL to File Append. To import the KMs, click the Project tab in the left panel and expand the KnowledgeModules folder. Right-click Loading (LKM) and select Import Knowledge Modules.

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

5.

On the screen that follows,in the File Name, navigate to xml-reference directory as shown in the following screenshot. Click Open.The files to import shouldappear in the Import Knowledge Modules window. Press and hold the CTRL key to select IKM SQL to File Append and LKM File to SQL. Click

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

3 of 23 3/23/2012 6:42 PM

Page 4: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

6. On Import Report window, click Close. Expand the Loading (LKM) and Integration (IKM) folders, and view each imported KM in the tree view as shown below.

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

4 of 23 3/23/2012 6:42 PM

Page 5: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

Creating a New Physical Schema for the Flat File Model

To create a Physical schema for a new flat file model, perform the following steps:

7.

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

8.

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

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

5 of 23 3/23/2012 6:42 PM

Page 6: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

9.

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

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

6 of 23 3/23/2012 6:42 PM

Page 7: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

Creating a New ODI Model for the Flat File Source

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

1. Click the Models tab in the left panel of ODI Designer. Click the Insert Model Folder icon, and then select New Model Folder. On the screen that appears, set the Name t

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

7 of 23 3/23/2012 6:42 PM

Page 8: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

2. Right-click the Files model folder and select New Model. On the screen that appears, enter the values provided in the following table. Select Reverse Engineer

Parameter Value

Name Flat_File_1

Technology File

Logical Schema FILE_DEMO_SRC

3. On the screen that appears, verify settings and click Save icon to save your model . very that your newly created model appeared in the tree view under Files node.

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

8 of 23 3/23/2012 6:42 PM

Page 9: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

Creating a New ODI Source Datastore for use with ODI Interface

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

1. Expand the Flat Files folder, right-click the newly created Flat_File_1 model, and then select New Datastore. On the screen that appears, set NameResource Name field. Select the SRC_SALES_PERSON.txt file and click Open.

Note: In this OBE, you use the sample files that are delivered with the ODI installation.

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

9 of 23 3/23/2012 6:42 PM

Page 10: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

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

3.

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

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

10 of 23 3/23/2012 6:42 PM

Page 11: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

4.

Point the cursor, and then click the ruler at the beginning of each column as shown below. The wizard marks each column.

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

11 of 23 3/23/2012 6:42 PM

Page 12: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

5.

After the columns are marked, click each column data and set the Name and Datatype for each column. For the names and data types of each column, refer to the followfinished.

Column Name Data Type

C1 SALES_PERSON_ID numeric

C2 FIRST_NAME string

C3 LAST_NAME string

C4 DATE_HIRED string

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

12 of 23 3/23/2012 6:42 PM

Page 13: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

13 of 23 3/23/2012 6:42 PM

Page 14: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

6.

The columns should now look as follows. Click OK to save the model. Expand Files >Flat_ File1 > SRC_SALES_PERSON (SRC_SALES_PERSON.txt)columns were successfully created as shown in the screenshot.

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

14 of 23 3/23/2012 6:42 PM

Page 15: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

Note: If the columns have not been created, edit the newly created datastore: right-click the SRC_SALES_PERSON datastore, select Edit, and repeat steps 3, 4, 5, and 6

7.

In the Flat_File_1 model, right-click SRC_SALES_PERSON datastore, and then select View Data option. Close all tabs.

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

15 of 23 3/23/2012 6:42 PM

Page 16: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

Creating a New ODI Target Datastore for use with ODI Interface

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

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

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

16 of 23 3/23/2012 6:42 PM

Page 17: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

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

3.

Right-click the newly created duplicate Copy of SRC_SALES_PERSON.txt and select Edit. On the screen that appears, set the Name to

TRG_SALES_PERSON. Click the button next to the Resource Name field.

Note: The Files tab and Columns tab do not need to be changed because they are duplicated from the source file

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

17 of 23 3/23/2012 6:42 PM

Page 18: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

4.

Select the TRG_SALES_PERSON.txt file and click Open. Click Save icon. The datastores for the source and target files have now beensuccessfully created in the same model and can be used in an ODI interface. Close editing tabs.

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

18 of 23 3/23/2012 6:42 PM

Page 19: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

Creating a New ODI Interface for Flat File to Flat File Transformations

To create a new interface, perform the following steps:

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

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

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

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

19 of 23 3/23/2012 6:42 PM

Page 20: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

3.

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

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

4.

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

5.

Click Target (FILE_GENERIC). This makes the properties for the target appear below. For IKM, select IKM SQL to File Append from the IKMdrop-down list if not already selected. Set the IKM options TRUNCATE to True and GENERATE_HEADER to False as shown below. Click Saveicon to save your interface .

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

20 of 23 3/23/2012 6:42 PM

Page 21: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

6. To test your interface, click Execute icon . The following screen appears. Retain the defaults and click OK. On the screen that follows, click

OK.

7.

To verify that your interface was executed successfully, you need to open ODI Operator. Click the ODI Operator tab. In ODI Operator, clickHierarchial Sessions. Expand Date > Today > INT_exp_FF_FF > Steps > INT_exp_FF_FF, and view the execution results for each step.Double-click any step and click the Description and Execution tabs to see the execution results. Double-click step 6. View the number of rowsthat are inserted into the target flat file. Click OK. Close the tabs.

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

21 of 23 3/23/2012 6:42 PM

Page 22: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

Summary

In this tutorial, you have learned how to:

Verify the PrerequisitesCreate a New Project with Oracle Data IntegratorCreate a New ODI Model for the Flat File SourceCreate a New ODI Source Datastore for Use with ODI InterfaceCreate a New ODI Target Datastore for Use with ODI InterfaceCreate a New Interface with Oracle Data Integrator for a flat file to a flat file data transformation

ResourcesOracle Data Intergator 11g DocumentationTo learn more about , refer to additional OBEs on the OTN Web site (can link to a specific set of OBEs on the subject)

User CommentsTitle:

Please log in or register first Post anonymously

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

22 of 23 3/23/2012 6:42 PM

Page 23: Creating an ODI Project and Interface_ Exporting a Flat File to a Flat File

By submitting a comment, you confirm that you have read and agreed to the terms and conditions.

This feedback form is for tutorial corrections and suggestions. Because of the volume of suggestions, we cannot reply to every comment. Inparticular:

If you have general questions about this Oracle software product, consult the OTN forums instead.If you are encountering a software problem and need to request support or consulting, file a service request on My Oracle Support.If you want to order hardcopy documentation, go to the Oracle Store.

(Comments are moderated and will not appear immediately.)

About Oracle | | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Your

Privacy Rights

Creating an ODI Project and Interface: Exporting a Flat File to a Flat File http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-...

23 of 23 3/23/2012 6:42 PM