You are on page 1of 36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

ODI11g:CreatinganODIProjectandInterface:ExportingaFlatFiletoaRDBMSTable
Thistutorialcontainsthefollowingsections:
Purpose
TimetoComplete
Overview
Scenario
SoftwareandHardwareRequirements
Prerequisites
CreatingaNewProjectwithOracleDataIntegrator
CreatingRDBMSSchemaforODITargetDatastore
CreatingaNewODITargetDataserverandthePhysicalSchema
CreatingaNewODITargetModel
CreatingaNewODIInterfacetoPerformFlatFiletoRDBMSTableTransformation
Summary
Resources

Purpose
ThistutorialwalksyouthroughthestepsthatareneededtocreateaprojectandaninterfaceinOracleDataIntegrator(ODI)toexportaflatfiletoanotherflatfile.

TimetoComplete
Approximately40minutes

Overview
AcommontaskthatisperformedusingODIistoexportdatafromaflatfileandloadthisdataintoRDBMStable.Thistutorialwalksyouthroughthestepsthatareneededto
createaprojectandaninterfacethatwillimportafiletoastagingarea,performsomeminortransformations,andthenwritethedatatoatable.Youalsoexecutetheinterface
andverifytheexecutionusingODIOperator.

Scenario
LindaworksasadatabaseadministratorforGlobalEnterprise.InGlobalEnterprise,Lindaisresponsibleforperformingdatabasemanagementandintegrationtaskson
variousresourceswithintheorganization.Inparticular,Lindaisresponsiblefordataloading,transformation,andvalidation.Tobeginworkingonherprojects,Lindacreated
thenewMasterrepositoryandWorkrepository.NowLindaneedstocreateaprojectandaninterfacetoexportdatafromasourceflatfile,performtransformations,andload
thisdataintoRDMBStable.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

1/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

SoftwareandHardwareRequirements
Thefollowingisalistofsoftwarerequirements:
Thesystemshouldincludethefollowinginstalledproducts:
OracleDatabase11g
OracleDataIntegrator11gR1
Ifnotdonebefore,starttheservicesandcomponentsforOracleDatabase11g

Prerequisites
Beforeyoustartthetasks,makesurethatyoursystemenvironmentmeetsthefollowingrequirements:
1. HaveinstalledOracleDatabase11g.Ifnotdonebefore,starttheservicesandcomponentsforOracleDatabase
11g
2. HaveinstalledOracleDataIntegrator11gR1
3. BeforeattemptingthisOBE,youshouldhavesuccessfullycompletedthefollowingOBEs:
ODI11g:CreatingandConnectingtoODIMasterandWorkRepositories.
ODI11g:CreatinganODIProjectandInterface:ExportingaFlatFiletoaFlatFile
ToaccesstheseOBEs,clickHERE.

CreatingaNewProjectwithOracleDataIntegrator
TocreateanewprojectwithinOracleDataIntegrator,performthefollowingsteps:
1. StartODIDesigner:Start>Programs>Oracle>OracleDataIntegrator>ODIStudio.SelectWORKREP1from
theLoginNamedropdownlistifnotalreadyselected.EnterSUPERVISORintheUserfieldandSUNOPSISinthe
Passwordfield.ClickOKtologin.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

2/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

2.

Inthedesignertab,clicktheProjectstab,clickNewProjecticon

,andthenclickNewProject.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

3/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

3. Onthescreenthatappears,settheNameoftheprojecttoODIexp_FT_RTintheNamefield.TheCodefieldis
filledautomatically.ClickSaveicon
.ThenewlycreatedODIexp_FT_RTprojectnowappearsintheProjects
treeview.YouhavenowsuccessfullyaddedanewODIproject.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

4/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

4. Youexportaflatfiledirectlytoarelationaltabletarget.TheknowledgemodulesrequiredforthisareLKMFileto
SQLandIKMSQLIncrementalUpdate.ToimporttheKMs,expandtheProjecttabintheleftpanel,rightclickthe
KnowledgeModulesfolderandselectImportKnowledgeModules.

Note:Inthisexample,thegenericSQLKMsareused.However,specificKMsfortheRDBMStechnologycanbe
usedaswell.

5. Onthescreenthatfollows,intheFileName,navigatetoxmlreferencedirectoryasshowninthefollowing
screenshot.ClickOpen.ThefilestoimportshouldappearintheImportKnowledgeModuleswindow.Pressand
holdtheCTRLkeytoselectIKMSQLtoIncrementalUpdateandLKMFiletoSQL.ClickOK.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

5/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

6. OnImportReportwindow,clickClose.ExpandtheLoading(LKM)andIntegration(IKM)folders,andvieweach
importedKMinthetreeviewasshownbelow.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

6/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

7/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

CreatingRDBMSSchemaforODITargetDatastore
YouneedtocreateaschematohosttheODIRDBMStargetdatastore.
Note:YoucreatedschemasfortheflatfilesourcemodelintheOBE:"CreatinganODIProjectandInterface:ExportingaFlatFiletoaFlatFile".
Note:IfyoucompletedtheOBE"CreatinganODIProjectandInterface:ExportinganRDBMSTabletoaFlatFile"earlier,youshouldalreadyhaveODI_STAGEschema
created.Inthiscase,youcanskipStep1andStep2.
TocreateanewRDBMSschemafortheODIdatastore,performthefollowingsteps:
1.

StartSQLDeveloper.Youwillcreatethenewschema/userbyexecutingthefollowingSQLcommands:
createuserODI_STAGEidentifiedbyODI_STAGE
defaulttablespaceuserstemporarytablespacetemp

grantconnect,resource,createtrigger,createviewtoODI_STAGE
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

8/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

2. InSQLDevelopercreatenewconnectioncalledODI_STAGE.EnterUsernameasODI_STAGEwithpassword
ODI_STAGE.ForSIDenterORCL.ClickTesttoverifyconnection,andthenclickConnect.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

9/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

3. CreateyourtargettablebyexecutingtheSQLcommandsprovidedbelow.ExpandconnectionODI_STAGE>
Tables>TRG_SALES_PERSONandverifythatthetableiscreatedsuccessfully.
Note:YoumayfindthesecommandsinthetextfilefrovidedwiththisOBE.Toaccessthisfile,clickHERE.
CREATEtable"TRG_SALES_PERSON"(
"SALES_PERSON_ID"NUMBER(8,0)NOTNULL,
"FIRST_NAME"VARCHAR2(80),
"LAST_NAME"VARCHAR2(80),
"DATE_HIRED"VARCHAR2(80),
"DATE_UPDATED"DATENOTNULL,
constraint"TRG_SALES_PERSON_PK"primarykey("SALES_PERSON_ID")
)
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

10/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

CreatingaNewODITargetDataserverandthePhysicalSchema
Note:Skipthissection,ifyoucompletedtheOBE"CreatinganODIProjectandInterface:ExportingRDBMSTabletoaFlatFile"earlier.
Afteryoucreatedthenewdatabasetargetdatastore,youneedtocreateanewODItargetdataserverandthePhysicalschema.TocreatetheODItargetdataserverand
physicalschema,performthefollowingsteps:
1. InODI,OpenODITopologyNavigatorandthenselectthePhysicalArchitecturetab.ExpandTechnologies,right
clickOracleandselectNewDataServer.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

11/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

2. IntheDataServer:Newwindow,enterthevaluesprovidedinthetablebelow.ClicktheJDBCtab.
Parameter

Value

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

12/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

Name

ODI_STAGE

Instance/dblink(DataServer) ORCL
User

ODI_STAGE

Password

ODI_STAGE

3.
Click
forJDBCDriver.SelectOracleJDBCDriver.ClickOK.Click
forJDBCUrl,select
jdbc:oracle:thin:@<host>:<port>:<sid>,andthenclickOK.EdittheUrltoread:
jdbc:oracle:thin:@localhost:1521:ORCLforOracleDatabase.
Note:DonotcopyandpasteintheJDBCUrlfield.ThismaycauseproblemswithenteringavalidURLstring.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

13/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

14/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

4. ClickTestConnection.Inthewindowthatopens,clickYestosaveyourdata.IntheInformationwindow,clickOK.
ClickTesttoverifysuccessfulconnection.ClickOK.

5. ClickExpandOracletechnologynode,rightclickODI_STAGEdataserver,andthenselectNewPhysicalSchema.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

15/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

6. InSchema(Schema)andSchema(WorkSchema)fieldenteryourODI_STAGEschema.ClickSavebutton.Close
ODI_STAGE.ODI_STAGEphysicalschemawindow.IntheInformationwindow,clickOK.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

16/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

7. OpenLogicalArchitecturetab,expandTechnologies>Oracle.RightclickOracletechnologyandthenselectNew
LogicalSchema.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

17/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

1. NamelogicalschemaODI_STAGE.IntheGlobalcontext,connectthislogicalschematoODI_STAGEphysical
schemaasshownbelow.ClickSavebuttonandthenclosethetabs.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

18/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

CreatingaNewODITargetModel
CreateanewODItargetmodelthatwillbeusedwithinyourODIInterface.TocreateanewODItargetmodel,performthefollowingsteps:
1. OpenODIDesigner.ClickModelstabandselectNewModel.Onthescreenthatappears,enterthevalues
providedinthefollowingtable.ClicktheReverseEngineertab.

Parameter

Value

Name

Oracle_RDBMS1

Technology

Oracle

LogicalSchema ODI_STAGE

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

19/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

2. OntheReverseEngineertab,settheContexttoGlobal.ClickSavebuttonandthencloseOracle_RDBMS1tab.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

20/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

3. IntheModelstab,rightclicktheOracle_RDBMS1model.SelectReverseEngineer.Toverifythatthe
TRG_SALES_PERSONdatastoreissuccessfullyreversedexpandthemodelasshownbelow.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

21/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

22/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

CreatingaNewODIInterfacetoPerformFlatFiletoRDBMSTableTransformation
TocreateanewODIInterfacetoperformflatfiletoRDBMStabletransformation,pefromthefollowingsteps:
1. InODIDesigner,clicktheProjectstab.ExpandyourprojectExportFFRT,andthenexpandFirstFolder.Rightclick
InterfacesandselectNewInterface.InOptimizationContextfield,selectDevelopment.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

23/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

2. Onthescreenthatfollows,entertheinterfacenameasINTEXPFFRT.Ifselected,deselecttheStagingArea
DifferentFromTargetcheckbox.ClicktheMappingtab.

3. ClicktheModelstabtodragthesourceandtargettothediagram.DragtheSRC_SALES_PERSON.txtdatastore
fromtheFlat_File1modelintotheSourcescontainer.DragtheTRG_SALES_PERSONdatastorefromthe
Oracle_RDBMS1modelintotheTargetDatastorecontainer.WhenDesignerasksDoyouwanttoperforman
AutomaticMapping?clickYes.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

24/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

4. SetthevaluefortheDATE_UPDATEDcolumninTargetDatastoretoSystemdate.InTargetDatastore,select
DATE_UPDATED.IntheImplementationtab,enterSYSDATE.SelectStagingAreaintheExecuteonsection.Make
surethatActiveMappingcheckboxisselected.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

25/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

5. SelecttheFIRSTNAMEcolumninTargetDatastoreandeditthemappingtoread:ltrim(SRC.FIRST_NAME).This
functionremovesleftspacesintheFIRST_NAMEcolumn.IntheExecuteonsection,selectStagingArea.Click
OK.RepeatthisstepforcolumnsLASTNAMEandDATEHIRED.Refertothemappingimplementationprovidedin
thetablebelow:

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

26/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

Column

Mappingimplementation

FIRSTNAME Ltrim(SRC.FIRST_NAME)
LASTNAME Ltrim(SRC.LAST_NAME)
DATEHIRED Ltrim(SRC.DATE_HIRED)

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

27/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

28/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

6. ClicktheFlowtab.ClicktheSrcSet_0(FILEGENERIC)datastore.Thepropertiesforthesourceappearbelow.For
LKM,selectLKMFiletoSQLfromtheLKMdropdownlistifnotselected.Nowyouneedtoensurethatthe
temporaryobjectscreatedduringtransformationaredeleted.SettheLKMoption
DELETE_TEMPORARY_OBJECTSto<Default>:trueasshownbelow.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

29/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

7. ClicktheTargetdatastore.SelectIKMSQLIncrementalUpdate.SettheIKMoptionFlow_ControltoFalse.Setthe
IKMoptionDELETE_ALLtoTrue.ClickSave

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

30/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

31/36

10/7/2015

8.

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

Totestyourinterface,clickExecutebutton
Onthenextscreen,clickOK.

.Thefollowingscreenappears.RetainthedefaultsandclickOK.

9. OpenODIOperatorandverifythatyourinterfacewasexecutedsuccessfully.InOperator,clickSessionListtab,
selectAllExecutions,andthethenclickrefreshbutton

.ViewexecutionresultsforinterfaceINTEXPFFRT.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

32/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

10. DoubleclickStep12andclicktheExecutiontab.Viewthenumberofrowsinsertedintothetargettable(16).

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

33/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

11. OpentheInterfacetab.SelectMappingtab,rightclickTargetDatastoreTRG_SALES_PERSON,andthenselect
Data..ViewDatainsertedinthetargettable.CloaeDataEditor.Closetabs.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

34/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

35/36

10/7/2015

CreatinganODIProjectandInterface:ExportingaFlatFiletoaTable

Summary
Inthistutorial,youhavelearnedhowto:
VerifythePrerequisites
CreateaNewProjectwithOracleDataIntegrator
CreateaNewODIModelfortheFlatFileSource
CreateaNewODISourceDatastoreforUsewithODIInterface
CreateaNewODIModelfortheRDBMSTarget
CreateaNewODITargetDatastoreforUsewithODIInterface
CreateaNewInterfacewithOracleDataIntegratorforaflatfiletoRDBMStabledatatransformations

Resources
OracleDataIntergator11gDocumentation
Tolearnmoreabout,refertoadditionalOBEsintheLearningLibrary.

AboutOracle |OracleandSun |

| Careers| ContactUs| SiteMaps| LegalNotices| TermsofUse |


YourPrivacyRights

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfiletotable/odi_project_flatfiletotable.htm?print=preview&imgs=visible

36/36

You might also like