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

  • Upload
    yasir

  • View
    13

  • Download
    0

Embed Size (px)

DESCRIPTION

Project

Citation preview

  • 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 1/36

    ODI11g:CreatinganODIProjectandInterface:ExportingaFlatFiletoaRDBMSTableThistutorialcontainsthefollowingsections:

    PurposeTimetoCompleteOverviewScenarioSoftwareandHardwareRequirementsPrerequisitesCreatingaNewProjectwithOracleDataIntegratorCreatingRDBMSSchemaforODITargetDatastoreCreatingaNewODITargetDataserverandthePhysicalSchemaCreatingaNewODITargetModelCreatingaNewODIInterfacetoPerformFlatFiletoRDBMSTableTransformationSummaryResources

    PurposeThistutorialwalksyouthroughthestepsthatareneededtocreateaprojectandaninterfaceinOracleDataIntegrator(ODI)toexportaflatfiletoanotherflatfile.

    TimetoCompleteApproximately40minutes

    OverviewAcommontaskthatisperformedusingODIistoexportdatafromaflatfileandloadthisdataintoRDBMStable.Thistutorialwalksyouthroughthestepsthatareneededtocreateaprojectandaninterfacethatwillimportafiletoastagingarea,performsomeminortransformations,andthenwritethedatatoatable.YoualsoexecutetheinterfaceandverifytheexecutionusingODIOperator.

    ScenarioLindaworksasadatabaseadministratorforGlobalEnterprise.InGlobalEnterprise,Lindaisresponsibleforperformingdatabasemanagementandintegrationtasksonvariousresourceswithintheorganization.Inparticular,Lindaisresponsiblefordataloading,transformation,andvalidation.Tobeginworkingonherprojects,LindacreatedthenewMasterrepositoryandWorkrepository.NowLindaneedstocreateaprojectandaninterfacetoexportdatafromasourceflatfile,performtransformations,andloadthisdataintoRDMBStable.

  • 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 2/36

    SoftwareandHardwareRequirements

    Thefollowingisalistofsoftwarerequirements:

    Thesystemshouldincludethefollowinginstalledproducts:OracleDatabase11gOracleDataIntegrator11gR1

    Ifnotdonebefore,starttheservicesandcomponentsforOracleDatabase11g

    Prerequisites

    Beforeyoustartthetasks,makesurethatyoursystemenvironmentmeetsthefollowingrequirements:

    1. HaveinstalledOracleDatabase11g.Ifnotdonebefore,starttheservicesandcomponentsforOracleDatabase11g

    2. HaveinstalledOracleDataIntegrator11gR1

    3. BeforeattemptingthisOBE,youshouldhavesuccessfullycompletedthefollowingOBEs:

    ODI11g:CreatingandConnectingtoODIMasterandWorkRepositories.ODI11g:CreatinganODIProjectandInterface:ExportingaFlatFiletoaFlatFile

    ToaccesstheseOBEs,clickHERE.

    CreatingaNewProjectwithOracleDataIntegratorTocreateanewprojectwithinOracleDataIntegrator,performthefollowingsteps:

    1. StartODIDesigner:Start>Programs>Oracle>OracleDataIntegrator>ODIStudio.SelectWORKREP1fromtheLoginNamedropdownlistifnotalreadyselected.EnterSUPERVISORintheUserfieldandSUNOPSISinthePasswordfield.ClickOKtologin.

  • 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 3/36

    2. Inthedesignertab,clicktheProjectstab,clickNewProjecticon ,andthenclickNewProject.

  • 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 4/36

    3. Onthescreenthatappears,settheNameoftheprojecttoODIexp_FT_RTintheNamefield.TheCodefieldis

    filledautomatically.ClickSaveicon .ThenewlycreatedODIexp_FT_RTprojectnowappearsintheProjectstreeview.YouhavenowsuccessfullyaddedanewODIproject.

  • 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 5/36

    4. Youexportaflatfiledirectlytoarelationaltabletarget.TheknowledgemodulesrequiredforthisareLKMFiletoSQLandIKMSQLIncrementalUpdate.ToimporttheKMs,expandtheProjecttabintheleftpanel,rightclicktheKnowledgeModulesfolderandselectImportKnowledgeModules.

    Note:Inthisexample,thegenericSQLKMsareused.However,specificKMsfortheRDBMStechnologycanbeusedaswell.

    5. Onthescreenthatfollows,intheFileName,navigatetoxmlreferencedirectoryasshowninthefollowingscreenshot.ClickOpen.ThefilestoimportshouldappearintheImportKnowledgeModuleswindow.PressandholdtheCTRLkeytoselectIKMSQLtoIncrementalUpdateandLKMFiletoSQL.ClickOK.

  • 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 6/36

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

  • 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

    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

    CreatingRDBMSSchemaforODITargetDatastoreYouneedtocreateaschematohosttheODIRDBMStargetdatastore.

    Note:YoucreatedschemasfortheflatfilesourcemodelintheOBE:"CreatinganODIProjectandInterface:ExportingaFlatFiletoaFlatFile".

    Note:IfyoucompletedtheOBE"CreatinganODIProjectandInterface:ExportinganRDBMSTabletoaFlatFile"earlier,youshouldalreadyhaveODI_STAGEschemacreated.Inthiscase,youcanskipStep1andStep2.

    TocreateanewRDBMSschemafortheODIdatastore,performthefollowingsteps:

    1.StartSQLDeveloper.Youwillcreatethenewschema/userbyexecutingthefollowingSQLcommands:

    createuserODI_STAGEidentifiedbyODI_STAGE

    defaulttablespaceuserstemporarytablespacetemp

    grantconnect,resource,createtrigger,createviewtoODI_STAGE

  • 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 9/36

    2. InSQLDevelopercreatenewconnectioncalledODI_STAGE.EnterUsernameasODI_STAGEwithpasswordODI_STAGE.ForSIDenterORCL.ClickTesttoverifyconnection,andthenclickConnect.

  • 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 10/36

    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")

    )

  • 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 11/36

    CreatingaNewODITargetDataserverandthePhysicalSchemaNote:Skipthissection,ifyoucompletedtheOBE"CreatinganODIProjectandInterface:ExportingRDBMSTabletoaFlatFile"earlier.

    Afteryoucreatedthenewdatabasetargetdatastore,youneedtocreateanewODItargetdataserverandthePhysicalschema.TocreatetheODItargetdataserverandphysicalschema,performthefollowingsteps:

    1. InODI,OpenODITopologyNavigatorandthenselectthePhysicalArchitecturetab.ExpandTechnologies,rightclickOracleandselectNewDataServer.

  • 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 12/36

    2. IntheDataServer:Newwindow,enterthevaluesprovidedinthetablebelow.ClicktheJDBCtab.

    Parameter Value

  • 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 13/36

    Name ODI_STAGE

    Instance/dblink(DataServer)ORCL

    User ODI_STAGE

    Password ODI_STAGE

    3.Click forJDBCDriver.SelectOracleJDBCDriver.ClickOK.Click forJDBCUrl,selectjdbc:oracle:thin:@::,andthenclickOK.EdittheUrltoread:jdbc:oracle:thin:@localhost:1521:ORCLforOracleDatabase.Note:DonotcopyandpasteintheJDBCUrlfield.ThismaycauseproblemswithenteringavalidURLstring.

  • 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

    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

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

    5. ClickExpandOracletechnologynode,rightclickODI_STAGEdataserver,andthenselectNewPhysicalSchema.

  • 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 16/36

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

  • 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 17/36

    7. OpenLogicalArchitecturetab,expandTechnologies>Oracle.RightclickOracletechnologyandthenselectNewLogicalSchema.

  • 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 18/36

    1. NamelogicalschemaODI_STAGE.IntheGlobalcontext,connectthislogicalschematoODI_STAGEphysicalschemaasshownbelow.ClickSavebuttonandthenclosethetabs.

  • 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 19/36

    CreatingaNewODITargetModelCreateanewODItargetmodelthatwillbeusedwithinyourODIInterface.TocreateanewODItargetmodel,performthefollowingsteps:

    1. OpenODIDesigner.ClickModelstabandselectNewModel.Onthescreenthatappears,enterthevaluesprovidedinthefollowingtable.ClicktheReverseEngineertab.

    Parameter Value

    Name Oracle_RDBMS1

    Technology Oracle

    LogicalSchemaODI_STAGE

  • 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 20/36

    2. OntheReverseEngineertab,settheContexttoGlobal.ClickSavebuttonandthencloseOracle_RDBMS1tab.

  • 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 21/36

    3. IntheModelstab,rightclicktheOracle_RDBMS1model.SelectReverseEngineer.ToverifythattheTRG_SALES_PERSONdatastoreissuccessfullyreversedexpandthemodelasshownbelow.

  • 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

    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

    CreatingaNewODIInterfacetoPerformFlatFiletoRDBMSTableTransformationTocreateanewODIInterfacetoperformflatfiletoRDBMStabletransformation,pefromthefollowingsteps:

    1. InODIDesigner,clicktheProjectstab.ExpandyourprojectExportFFRT,andthenexpandFirstFolder.RightclickInterfacesandselectNewInterface.InOptimizationContextfield,selectDevelopment.

  • 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 24/36

    2. Onthescreenthatfollows,entertheinterfacenameasINTEXPFFRT.Ifselected,deselecttheStagingAreaDifferentFromTargetcheckbox.ClicktheMappingtab.

    3. ClicktheModelstabtodragthesourceandtargettothediagram.DragtheSRC_SALES_PERSON.txtdatastorefromtheFlat_File1modelintotheSourcescontainer.DragtheTRG_SALES_PERSONdatastorefromtheOracle_RDBMS1modelintotheTargetDatastorecontainer.WhenDesignerasksDoyouwanttoperformanAutomaticMapping?clickYes.

  • 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 25/36

    4. SetthevaluefortheDATE_UPDATEDcolumninTargetDatastoretoSystemdate.InTargetDatastore,selectDATE_UPDATED.IntheImplementationtab,enterSYSDATE.SelectStagingAreaintheExecuteonsection.MakesurethatActiveMappingcheckboxisselected.

  • 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 26/36

    5. SelecttheFIRSTNAMEcolumninTargetDatastoreandeditthemappingtoread:ltrim(SRC.FIRST_NAME).ThisfunctionremovesleftspacesintheFIRST_NAMEcolumn.IntheExecuteonsection,selectStagingArea.ClickOK.RepeatthisstepforcolumnsLASTNAMEandDATEHIRED.Refertothemappingimplementationprovidedinthetablebelow:

  • 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 27/36

    Column Mappingimplementation

    FIRSTNAME Ltrim(SRC.FIRST_NAME)

    LASTNAME Ltrim(SRC.LAST_NAME)

    DATEHIRED Ltrim(SRC.DATE_HIRED)

  • 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

    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

    6. ClicktheFlowtab.ClicktheSrcSet_0(FILEGENERIC)datastore.Thepropertiesforthesourceappearbelow.ForLKM,selectLKMFiletoSQLfromtheLKMdropdownlistifnotselected.Nowyouneedtoensurethatthetemporaryobjectscreatedduringtransformationaredeleted.SettheLKMoptionDELETE_TEMPORARY_OBJECTSto:trueasshownbelow.

  • 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 30/36

    7. ClicktheTargetdatastore.SelectIKMSQLIncrementalUpdate.SettheIKMoptionFlow_ControltoFalse.Setthe

    IKMoptionDELETE_ALLtoTrue.ClickSave .

  • 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 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 32/36

    8.Totestyourinterface,clickExecutebutton .Thefollowingscreenappears.RetainthedefaultsandclickOK.Onthenextscreen,clickOK.

    9. OpenODIOperatorandverifythatyourinterfacewasexecutedsuccessfully.InOperator,clickSessionListtab,

    selectAllExecutions,andthethenclickrefreshbutton .ViewexecutionresultsforinterfaceINTEXPFFRT.

  • 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 33/36

    10. DoubleclickStep12andclicktheExecutiontab.Viewthenumberofrowsinsertedintothetargettable(16).

  • 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 34/36

    11. OpentheInterfacetab.SelectMappingtab,rightclickTargetDatastoreTRG_SALES_PERSON,andthenselectData..ViewDatainsertedinthetargettable.CloaeDataEditor.Closetabs.

  • 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

    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

    Summary

    Inthistutorial,youhavelearnedhowto:

    VerifythePrerequisitesCreateaNewProjectwithOracleDataIntegratorCreateaNewODIModelfortheFlatFileSourceCreateaNewODISourceDatastoreforUsewithODIInterfaceCreateaNewODIModelfortheRDBMSTargetCreateaNewODITargetDatastoreforUsewithODIInterfaceCreateaNewInterfacewithOracleDataIntegratorforaflatfiletoRDBMStabledatatransformations

    ResourcesOracleDataIntergator11gDocumentationTolearnmoreabout,refertoadditionalOBEsintheLearningLibrary.

    AboutOracle|OracleandSun| |Careers|ContactUs|SiteMaps|LegalNotices|TermsofUse|YourPrivacyRights