Complete Reference to Informatica_ SCD Type 1

Download Complete Reference to Informatica_ SCD  Type 1

Post on 08-Jul-2016

212 views

Category:

Documents

0 download

DESCRIPTION

scd type 1

TRANSCRIPT

  • 5/14/2016 CompletereferencetoInformatica:SCDType1

    http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 1/6

    Home Data WareHousing Unix-Shell Scripts PL SQL Contact Us

    PERFORMANCE TUNINGNecessityOfPerformancetuningIdentificationOfbottleNecksOptimizationofBottlenecksPerformancetuningofLookupPushDownOptimization

    TESTINGUnitTestingIntegrationTestingUATInformaticaTestingDebuggerConstraintBasedloadingTargetLoadPlan

    INTERVIEW ZONEInformaticaRealTimeInterviewQuestionsInformaticaExperiencedInterviewQuestionspart1InformaticaExperiencedInterviewQuestionspart2InformaticaExperiencedInterviewQuestionspart3InformaticaExperiencedInterviewQuestionspart4DataWarehousingconceptBasedInterviewQuestions

    17

    TOTAL VISITS

    FEEDS

    DISCUSSION FORUMDiscussionForum

    SUBSCRIBE TO LEARN INFORMATICA512peoplelikethis.

    Like Share

    Sunday,17April2011

    SCDType1

    SlowlyChangingDimensions(SCDs)aredimensionsthathavedatathatchangesslowly,ratherthanchangingonatimebased,regularschedule

    Forexample,youmayhaveadimensioninyourdatabasethattracksthesalesrecordsofyourcompany'ssalespeople.Creatingsalesreportsseemssimpleenough,untilasalespersonistransferredfromoneregionalofficetoanother.Howdoyourecordsuchachangeinyoursalesdimension?

    Youcouldsumoraveragethesalesbysalesperson,butifyouusethattocomparetheperformanceofsalesmen,thatmightgivemisleadinginformation.Ifthesalespersonthatwastransferredusedtoworkinahotmarketwheresaleswereeasy,andnowworksinamarketwheresalesareinfrequent,hertotalswilllookmuchstrongerthantheothersalespeopleinhernewregion,eveniftheyarejustasgood.Oryoucouldcreateasecondsalespersonrecordandtreatthetransferredpersonasanewsalesperson,butthatcreatesproblemsalso.

    DealingwiththeseissuesinvolvesSCDmanagementmethodologies:

    Type1:

    TheType1methodologyoverwritesolddatawithnewdata,andthereforedoesnottrackhistoricaldataatall.Thisismostappropriatewhencorrectingcertaintypesofdataerrors,suchasthespellingofaname.(Assumingyouwon'teverneedtoknowhowitusedtobemisspelledinthepast.)

    Hereisanexampleofadatabasetablethatkeepssupplierinformation:

    Supplier_KeySupplier_CodeSupplier_Name Supplier_State

    123 ABC AcmeSupplyCoCA

    Inthisexample,Supplier_CodeisthenaturalkeyandSupplier_Keyisasurrogatekey.Technically,thesurrogatekeyisnotnecessary,sincethetablewillbeuniquebythenaturalkey(Supplier_Code).However,thejoinswillperformbetteronanintegerthanonacharacterstring.

    NowimaginethatthissuppliermovestheirheadquarterstoIllinois.Theupdatedtablewouldsimplyoverwritethisrecord:

    Supplier_KeySupplier_CodeSupplier_Name Supplier_State

    123 ABC AcmeSupplyCo IL

    TheobviousdisadvantagetothismethodofmanagingSCDsisthatthereisnohistoricalrecordkeptinthedatawarehouse.Youcan'ttellifyoursuppliersaretendingtomovetotheMidwest,forexample.ButanadvantagetoType1SCDsisthattheyareveryeasytomaintain.

    ExplanationwithanExample:

    SourceTable:(010111)TargetTable:(010111)

    INTRODUCTIONETLLifeCycleWhatIsInformaticaClientComponentsServicesBehindSceneTryURHand'sonAdminConsoleDifferenceBetween7.1and8.6Informatica8.6Installation

    ADVANCED CONCEPTSMappingParameter's&VariableMappletsPartitioningWorkingwithlinksSchedulerTypesofTask's1TypesofTask's2IndirectMethodforLoadingSCDType1SCDType2SCDType3IncrementalAggregationMappingTemplatesGridProcessingFrequentlyUsedFunctionsWorkFlowVariables

    TRANSFORMATIONFilterExpressionRouterSorterRankTransactionControlSourceQualifierStoredProcedureSQLTransformationNormalizerSequenceGeneratorAggregatorUnionJoinerUpdateStrategyLookUp

    Complet referenc t Informatic

  • 5/14/2016 CompletereferencetoInformatica:SCDType1

    http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 2/6

    Enteryouremailaddress:

    Subscribe

    DeliveredbyFeedBurner

    Empno Ename Sal

    101 A 1000

    102 B 2000

    103 C 3000

    Empno Ename Sal

    101 A 1000

    102 B 2000

    103 C 3000

    Thenecessityofthelookuptransformationisillustratedusingtheabovesourceandtargettable.

    SourceTable:(010211)TargetTable:(010211)

    Empno Ename Sal Empno Ename Sal

    101 A 1000 101 A 1000

    102 B 2500 102 B 2500

    103 C 3000 103 C 3000

    104 D 4000 104 D 4000

    InthesecondMonthwehaveonemoreemployeeaddeduptothetablewiththeEnameDandsalaryoftheEmployeeischangedtothe2500insteadof2000.

    Step1:IstoimportSourceTableandTargettable.

    Createatablebynameemp_sourcewiththreecolumnsasshownaboveinoracle.Importthesourcefromthesourceanalyzer.Inthesamewayasabovecreatetwotargettableswiththenamesemp_target1,emp_target2.GotothetargetsMenuandclickongenerateandexecutetoconfirmthecreationofthetargettables.Thesnapshotoftheconnectionsusingdifferentkindsoftransformationsareshownbelow.

  • 5/14/2016 CompletereferencetoInformatica:SCDType1

    http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 3/6

    Step2:Designthemappingandapplythenecessarytransformation.

    HereinthistransformationweareabouttousefourkindsoftransformationsnamelyLookuptransformation,ExpressionTransformation,FilterTransformation,UpdateTransformation.Necessityandtheusageofallthetransformationswillbediscussedindetailbelow.

    LookupTransformation:Thepurposeofthistransformationistodeterminewhethertoinsert,Delete,Updateorrejecttherowsintotargettable.

    ThefirstthingthatwearegoannadoistocreatealookuptransformationandconnecttheEmpnofromthesourcequalifiertothetransformation.ThesnapshotofchoosingtheTargettableisshownbelow.

    WhatLookuptransformationdoesinourmappingisitlooksintothetargettable(emp_table)andcomparesitwiththeSourceQualifieranddetermineswhethertoinsert,update,deleteorrejectrows.InthePortstabweshouldaddanewcolumnandnameitasempno1andthisiscolumnforwhichwearegonnaconnectfromtheSourceQualifier.TheInputPortforthefirstcolumnshouldbeunchkedwhereastheotherportslikeOutputandlookupboxshouldbechecked.Forthenewlycreatedcolumnonlyinputandoutputboxesshouldbechecked.InthePropertiestab(i)Lookuptablename>Emp_Target.

    (ii)LookupPolicyonMultipleMismatch>useFirstValue.

    (iii)ConnectionInformation>Oracle.

    IntheConditionstab(i)ClickonAddanewcondition

  • 5/14/2016 CompletereferencetoInformatica:SCDType1

    http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 4/6

    (ii)LookupTableColumnshouldbeEmpno,TransformationportshouldbeEmpno1andOperatorshould=.

    ExpressionTransformation:AfterwearedonewiththeLookupTransformationweareusinganexpressiontransformationtocheckwhetherweneedtoinserttherecordsthesamerecordsorweneedtoupdatetherecords.ThestepstocreateanExpressionTransformationareshownbelow.

    DragallthecolumnsfromboththesourceandthelookuptransformationanddropthemallontotheExpressiontransformation.NowdoubleclickontheTransformationandgotothePortstabandcreatetwonewcolumnsandnameitasinsertandupdate.BoththesecolumnsaregonnabeouroutputdatasoweneedtohavecheckmarkonlyinfrontoftheOutputcheckbox.TheSnapshotfortheEdittransformationwindowisshownbelow.

    Theconditionthatwewanttoparsethroughouroutputdataarelistedbelow.

    InputIsNull(EMPNO1)

    Outputiif(Notisnull(EMPNO1)andDecode(SAL,SAL1,1,0)=0,1,0).

    Wearealldonehere.ClickonapplyandthenOK.

    FilterTransformation:wearegonnahavetwofiltertransformationsonetoinsertandothertoupdate.

    ConnecttheInsertcolumnfromtheexpressiontransformationtotheinsertcolumninthefirstfiltertransformationandinthesamewaywearegonnaconnecttheupdatecolumnintheexpressiontransformationtotheupdatecolumninthesecondfilter.LaternowconnecttheEmpno,Ename,Salfromtheexpressiontransformationtobothfiltertransformation.Ifthereisnochangeininputdatathenfiltertransformation1forwardsthecompleteinputtoupdatestrategytransformation1andsameoutputisgonnaappearinthetargettable.Ifthereisanychangeininputdatathenfiltertransformation2forwardsthecompleteinputtotheupdatestrategytransformation2thenitisgonnaforwardtheupdatedinputtothetargettable.GotothePropertiestabontheEdittransformation

    (i)Thevalueforthefiltercondition1isInsert.

    (ii)Thevalueforthefiltercondition1isUpdate.

    TheCloserviewofthefilterConnectionisshownbelow.

  • 5/14/2016 CompletereferencetoInformatica:SCDType1

    http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 5/6

    UpdateStrategyTransformation:Determineswhethertoinsert,delete,updateorrejecttherows.

    DragtherespectiveEmpno,EnameandSalfromthefiltertransformationsanddropthemontherespectiveUpdateStrategyTransformation.NowgotothePropertiestabandthevaluefortheupdatestrategyexpressionis0

    (onthe1stupdatetransformation).NowgotothePropertiestabandthevaluefortheupdatestrategyexpressionis1

    (onthe2ndupdatetransformation).Weareallsetherefinallyconnecttheoutputsoftheupdatetransformationstothetargettable.

    Step3:CreatethetaskandRuntheworkflow.

    Dontcheckthetruncatetableoption.ChangeBulktotheNormal.Runtheworkflowfromtask.

    Step4:PreviewtheOutputinthetargettable.

    PostedbyNaveenatSunday,April17,2011

  • 5/14/2016 CompletereferencetoInformatica:SCDType1

    http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 6/6

    Nocomments:

    PostaComment

    Enteryourcomment...

    Commentas: GoogleAccount

    Publish Preview

    Linkstothispost

    CreateaLink

Recommended

View more >