ODI11g: 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 <>.

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.

Ti e to Co plete
Approximately ! minutes

O!er!ie"
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. #ou also execute the interface and $erify the execution using ODI Operator.

#cenario
%inda works as a data&ase administrator for 'lo&al (nterprise. In 'lo&al (nterprise" %inda is responsi&le for performing data&ase management and integration tasks on $arious resources within the organi)ation. In particular" %inda is responsi&le for data loading" transformation" and $alidation. To &egin working on her projects" %inda created the new *aster repository and +ork repository. ,ow %inda 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.

#oft"are and $ard"are %e&uire ents 'Optional(
The following is a list of software re-uirements.

• o o •

The system should include the following installed products. Oracle Data&ase //g Oracle Data Integrator //g0/ If not done &efore" start the ser$ices and components for Oracle Data&ase //g

Prere&uisites
1efore you start the tasks" make sure that your system en$ironment meets the following re-uirements. 1 ) 2a$e installed Oracle Data&ase //g. If not done &efore" start the ser$ices and components for Oracle Data&ase //g * ) 2a$e installed Oracle Data Integrator //g0/ + ) 1efore attempting this O1(" you should ha$e successfully completed the following O1(. ODI11g: Creating and Connecting to ODI Master and Work Repositories. To access this O1(" click HERE.

Creating a New Project with Oracle Data Integrator
To create a new project within Oracle Data Integrator" perform the following steps. 3tart ODI Designer. #tart 4 Progra s 4 Oracle 4 Oracle Data Integrator 4 ODI #tudio . 3elect ,O%-%EP1 from 1) the %ogin ,ame drop5down list if not already selected. (nter #.PE%/I#O% in the 6ser field and #.NOP#I# in the 7assword field. 8lick O- to login.

*)

In the designer ta&" click the Projects ta&" click ,ew 7roject icon

" and then click Ne" Project.

On the screen that appears" set the Na e of the project to ODIexp0%T0%T in the Na e field. The Code field is filled +) automatically. 8lick #a!e icon . The newly created ODIexp0%T0%T project now appears in the 7rojects tree

*s" click the Project ta& in the left panel and expand the -no"ledge 2odules folder.*s are used. 0ight5click 3oading '3-2( and select I port -no"ledge 2odules. 8lick O-.$iew. Note: In this example" the generic 3:% . To import the . On the screen that follows"in the File Na e7 na$igate to x l8reference directory as shown in the following 6 ) screenshot. 2owe$er" specific . 7ress and hold the 8T0% key to select I-2 #43 to File 5ppend and 3-2 File to #43. #ou ha$e now successfully added a new ODI project.The files to import should appear in the I port -no"ledge 2odules window.*s for the 0D1*3 technology can &e used as well. 9or this interface" %inda has to import a flat file into the 3:% staging area" and then export the file to a different flat 1 ) file. 8lick Open. The -no"ledge 2odules '-2s( that are re-uired for this are 3-2 File to #43 and I-2 #43 to File 5ppend. .

On Import 0eport window" click Close. . (xpand the 3oading '3-2( and Integration 'I-2( folders" and $iew each 9) imported .* in the tree $iew as shown &elow.

Creating a New Physical Schema for the Flat File Model .

ew 7hysical 3chema. 8lose editing window for your new physical schema. .=Oracle=*iddleware=Oracle<ODI/=oracledi=demo=file ). 0ight5 click 9I%(<'(. 3elect Default check &ox" and then click 3a$e &utton.(0I8" and then select .(0I8 data ser$er in the Technologies tree $iew. On the Information window that follows" click O.To create a 7hysical schema for a new flat file model" perform the following steps. 1 ) 8lick Topology ta&. In Topology na$igator" click the 7hysical Architecture ta&" select Technologies 4 9ile. * ) 9or the Directory (3chema) and Directory (+ork 3chema) fields" enter the path to the directory" where your input flat files are located ( 8. >erify that your new 7hysical schema was added under the 9I%(<'(..

. 8lick 3a$e and close the editing windows.ew %ogical 3chema. (nter the %ogical 3chema name.+ ) .Open %ogical Architecture" na$igate to Technologies 4 9ile" right5click 9ile and select . 9%AT<9I%(3<308" select the your nely created physical schema in 'lo&al context as shown &elow.

. 8lick the 2odels ta& in the left panel of ODI Designer.ew 1) *odel 9older.ame to Files. 8lick #a!e icon. On the screen that appears" set the .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. . 8lick the Insert 2odel Folder icon" and then select .

On the screen that appears" enter the $alues pro$ided in *) the following ta&le. 7arameter .0ight5click the Files model folder and select Ne" 2odel.ame Technology %ogical 3chema >alue Flat_File_1 File FILE_DEMO_SRC . 3elect %e!erse Engineer ta&.

.On the screen that appears" $erify settings and click #a!e icon to sa$e your model . $ery that your newly created +) model appeared in the tree $iew under 9iles node.

(xpand the 9lat 9iles folder" right5click the newly created Flat0File01 model" and then select Ne" Datastore. next to the %esource Na e field. . 8lick the &utton 3elect the #%C0#53E#0PE%#ON)txt file and click Open. Note: In this O1(" you use the sample files that are deli$ered with the ODI installation. On the 1) screen that appears" set Na e to #%C0#53E#0PE%#ON.Creating a New ODI Source Datastore for use with ODI Interface To create a new ODI source datastore" perform the following steps.

3et the File For at to Fixed" and then click the Colu ns ta&.8lick the Files ta&. *) .

.On the Colu ns ta&" click the %e!erse Engineer &utton.ard appears.. 8lick :es.i. The following screen appears. The Colu n + ) #etup .

The wi)ard marks each 1 ) column.7oint the cursor" and then click the ruler at the &eginning of each column as shown &elow. .

A*( %A3T<. 9or the 6 ) names and data types of each column" refer to the following ta&le.ame 3A%(3<7(03O.<ID 9I03T<.A*( DAT(<2I0(D Data Type numeric string string string . 8lick O. 8olumn 8/ 8? 8@ 8 .After the columns are marked" click each column data and set the Na e and Datat<pe for each column.when you ha$e finished.

.

to sa$e the model. . 8lick O. >erify that the columns were successfully created as shown in the screenshot.The columns should now look as follows. (xpand Files 49lat< File1 4 9 ) #%C0#53E#0PE%#ON '#%C0#53E#0PE%#ON)txt( 4 Colu ns to $iew your source model.

Note: If the columns ha$e not &een created" edit the newly created datastore. . In the Flat0File01 model" right5click #%C0#53E#0PE%#ON datastore" and then select >iew Data option. right5click the #%C0#53E#0PE%#ON datastore" select (dit" and repeat steps @" " A" and B. 8lose all = ) ta&s.

.

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 O1(" you use the sample files that are deli$ered with the ODI installation. . *ake a copy of the #%C0#53E#0PE%#ON)txt file and name the copy T%?0#53E#0PE%#ON)txt as shown in the example in the following screenshots. 1rowse to the ODI0$O2E>de o>file directory (C:>Oracle>2iddle"are>Oracle0ODI1>oracledi>de o>file).

On the screen that follows" click :es.*) In ODI Designer" right5click the newly created source datastore #%C0#53E#0PE%#ON and select Duplicate. + ) 0ight5click the newly created duplicate Cop< of #%C0#53E#0PE%#ON)txt and select Edit. 8lick the &utton next to the %esource Na e field. On the screen that appears" set the Na e to T%?0#53E#0PE%#ON. The new Cop< of #%C0#53E#0PE%#ON)txt appears in the tree $iew. Note: The 9iles ta& and 8olumns ta& do not need to &e changed &ecause they are duplicated from the source file .

1 ) 3elect the T%?0#53E#0PE%#ON)txt file and click Open. 8lose editing ta&s. . 8lick #a!e icon. The datastores for the source and target files ha$e now &een successfully created in the same model and can &e used in an ODI interface.

.

*) On the screen that follows" enter the interface name as INT0exp0FT0FT. 0ight5click Interfaces and select Insert Interface. If the $elp screen appears" click O-. (xpand your project ODIexp0%T0%T" and then expand First Folder. 1) In ODI Designer" click the Projects ta&. 8lick the 2apping ta&.NOP#I#02E2O%:0EN?INE from drop5down list. Note: 9or this O1(" we will use the 3unopsis *emory (ngine as our staging area &ecause we want to perform some transformations on the imported data. 3elect In82e or< Engine: #.Creating a New ODI Interface for Flat File to Flat File Transformations To create a new interface" perform the following steps. .

. The mapping should &e performed in the staging area.* drop5down list if not already selected.+ ) 8lick the 2odels ta& to drag the source and target to Designer. In the 3-2 #elector section" select 3-2 File to #43 from the %. The Diagram ta& should look as follows. Note: 9or the purposes of this tutorial" default mappings are used" although a num&er transformation can &e performed in the mapping. 8lick the Flo" ta&. (xpand Files 4 Flat0File01 and drag the #%C0#53E#0PE%#ON datastore from the Files folder into the #ources container. 1 ) 8lick the ##0A '1 8 FI3E0?ENE%IC( source datastore. This makes the properties for the source appear &elow. +hen Designer asks CDo <ou "ant to perfor an 5uto atic 2apping@C click :es. Drag the T%?0#53E#0PE%#ON)txt datastore from Files into the Target Datastore container.

9) To test your interface" click Execute icon the screen that follows" click O-.NC5TE to True and ?ENE%5TE0$E5DE% to False as shown &elow.6 ) 8lick Target 'FI3E0?ENE%IC(. . 8lick #a!e icon to sa$e your interface . The following screen appears. 9or I-2" select I-2 #43 to File 5ppend from the I-2 drop5down list if not already selected. This makes the properties for the target appear &elow. On . 3et the I. 0etain the defaults and click O-.* options T%.

. 8lick O-. 8lose the ta&s. (xpand Date 4 Toda< 4 INT0exp0FF0FF > #teps > INT0exp0FF0FF" and $iew the execution results for each step. >iew the num&er of rows that are inserted into the target flat file. Dou&le5click any step and click the Description and Execution ta&s to see the execution results.= ) To $erify that your interface was executed successfully" you need to open ODI Operator. 8lick the ODI Operator ta&. In ODI Operator" click 2ierarchial 3essions. Dou&le5click step B.

Sign up to vote on this title
UsefulNot useful