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

Embed Size (px)

DESCRIPTION

scd type 1

TRANSCRIPT

<ul><li><p>5/14/2016 CompletereferencetoInformatica:SCDType1</p><p>http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 1/6</p><p>Home Data WareHousing Unix-Shell Scripts PL SQL Contact Us</p><p>PERFORMANCE TUNINGNecessityOfPerformancetuningIdentificationOfbottleNecksOptimizationofBottlenecksPerformancetuningofLookupPushDownOptimization</p><p>TESTINGUnitTestingIntegrationTestingUATInformaticaTestingDebuggerConstraintBasedloadingTargetLoadPlan</p><p>INTERVIEW ZONEInformaticaRealTimeInterviewQuestionsInformaticaExperiencedInterviewQuestionspart1InformaticaExperiencedInterviewQuestionspart2InformaticaExperiencedInterviewQuestionspart3InformaticaExperiencedInterviewQuestionspart4DataWarehousingconceptBasedInterviewQuestions</p><p>17</p><p>TOTAL VISITS</p><p>FEEDS</p><p>DISCUSSION FORUMDiscussionForum</p><p>SUBSCRIBE TO LEARN INFORMATICA512peoplelikethis.</p><p>Like Share</p><p>Sunday,17April2011</p><p>SCDType1 </p><p>SlowlyChangingDimensions(SCDs)aredimensionsthathavedatathatchangesslowly,ratherthanchangingonatimebased,regularschedule</p><p>Forexample,youmayhaveadimensioninyourdatabasethattracksthesalesrecordsofyourcompany'ssalespeople.Creatingsalesreportsseemssimpleenough,untilasalespersonistransferredfromoneregionalofficetoanother.Howdoyourecordsuchachangeinyoursalesdimension?</p><p>Youcouldsumoraveragethesalesbysalesperson,butifyouusethattocomparetheperformanceofsalesmen,thatmightgivemisleadinginformation.Ifthesalespersonthatwastransferredusedtoworkinahotmarketwheresaleswereeasy,andnowworksinamarketwheresalesareinfrequent,hertotalswilllookmuchstrongerthantheothersalespeopleinhernewregion,eveniftheyarejustasgood.Oryoucouldcreateasecondsalespersonrecordandtreatthetransferredpersonasanewsalesperson,butthatcreatesproblemsalso.</p><p>DealingwiththeseissuesinvolvesSCDmanagementmethodologies:</p><p>Type1:</p><p>TheType1methodologyoverwritesolddatawithnewdata,andthereforedoesnottrackhistoricaldataatall.Thisismostappropriatewhencorrectingcertaintypesofdataerrors,suchasthespellingofaname.(Assumingyouwon'teverneedtoknowhowitusedtobemisspelledinthepast.)</p><p>Hereisanexampleofadatabasetablethatkeepssupplierinformation:</p><p>Supplier_KeySupplier_CodeSupplier_Name Supplier_State</p><p>123 ABC AcmeSupplyCoCA</p><p>Inthisexample,Supplier_CodeisthenaturalkeyandSupplier_Keyisasurrogatekey.Technically,thesurrogatekeyisnotnecessary,sincethetablewillbeuniquebythenaturalkey(Supplier_Code).However,thejoinswillperformbetteronanintegerthanonacharacterstring.</p><p>NowimaginethatthissuppliermovestheirheadquarterstoIllinois.Theupdatedtablewouldsimplyoverwritethisrecord:</p><p>Supplier_KeySupplier_CodeSupplier_Name Supplier_State</p><p>123 ABC AcmeSupplyCo IL</p><p>TheobviousdisadvantagetothismethodofmanagingSCDsisthatthereisnohistoricalrecordkeptinthedatawarehouse.Youcan'ttellifyoursuppliersaretendingtomovetotheMidwest,forexample.ButanadvantagetoType1SCDsisthattheyareveryeasytomaintain.</p><p>ExplanationwithanExample:</p><p>SourceTable:(010111)TargetTable:(010111)</p><p>INTRODUCTIONETLLifeCycleWhatIsInformaticaClientComponentsServicesBehindSceneTryURHand'sonAdminConsoleDifferenceBetween7.1and8.6Informatica8.6Installation</p><p>ADVANCED CONCEPTSMappingParameter's&amp;VariableMappletsPartitioningWorkingwithlinksSchedulerTypesofTask's1TypesofTask's2IndirectMethodforLoadingSCDType1SCDType2SCDType3IncrementalAggregationMappingTemplatesGridProcessingFrequentlyUsedFunctionsWorkFlowVariables</p><p>TRANSFORMATIONFilterExpressionRouterSorterRankTransactionControlSourceQualifierStoredProcedureSQLTransformationNormalizerSequenceGeneratorAggregatorUnionJoinerUpdateStrategyLookUp</p><p>Complet referenc t Informatic</p></li><li><p>5/14/2016 CompletereferencetoInformatica:SCDType1</p><p>http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 2/6</p><p>Enteryouremailaddress:</p><p>Subscribe</p><p>DeliveredbyFeedBurner</p><p>Empno Ename Sal</p><p>101 A 1000</p><p>102 B 2000</p><p>103 C 3000</p><p>Empno Ename Sal</p><p>101 A 1000</p><p>102 B 2000</p><p>103 C 3000</p><p>Thenecessityofthelookuptransformationisillustratedusingtheabovesourceandtargettable.</p><p>SourceTable:(010211)TargetTable:(010211)</p><p>Empno Ename Sal Empno Ename Sal</p><p>101 A 1000 101 A 1000</p><p>102 B 2500 102 B 2500</p><p>103 C 3000 103 C 3000</p><p>104 D 4000 104 D 4000</p><p>InthesecondMonthwehaveonemoreemployeeaddeduptothetablewiththeEnameDandsalaryoftheEmployeeischangedtothe2500insteadof2000.</p><p>Step1:IstoimportSourceTableandTargettable.</p><p>Createatablebynameemp_sourcewiththreecolumnsasshownaboveinoracle.Importthesourcefromthesourceanalyzer.Inthesamewayasabovecreatetwotargettableswiththenamesemp_target1,emp_target2.GotothetargetsMenuandclickongenerateandexecutetoconfirmthecreationofthetargettables.Thesnapshotoftheconnectionsusingdifferentkindsoftransformationsareshownbelow.</p></li><li><p>5/14/2016 CompletereferencetoInformatica:SCDType1</p><p>http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 3/6</p><p>Step2:Designthemappingandapplythenecessarytransformation.</p><p>HereinthistransformationweareabouttousefourkindsoftransformationsnamelyLookuptransformation,ExpressionTransformation,FilterTransformation,UpdateTransformation.Necessityandtheusageofallthetransformationswillbediscussedindetailbelow.</p><p>LookupTransformation:Thepurposeofthistransformationistodeterminewhethertoinsert,Delete,Updateorrejecttherowsintotargettable.</p><p>ThefirstthingthatwearegoannadoistocreatealookuptransformationandconnecttheEmpnofromthesourcequalifiertothetransformation.ThesnapshotofchoosingtheTargettableisshownbelow.</p><p>WhatLookuptransformationdoesinourmappingisitlooksintothetargettable(emp_table)andcomparesitwiththeSourceQualifieranddetermineswhethertoinsert,update,deleteorrejectrows.InthePortstabweshouldaddanewcolumnandnameitasempno1andthisiscolumnforwhichwearegonnaconnectfromtheSourceQualifier.TheInputPortforthefirstcolumnshouldbeunchkedwhereastheotherportslikeOutputandlookupboxshouldbechecked.Forthenewlycreatedcolumnonlyinputandoutputboxesshouldbechecked.InthePropertiestab(i)Lookuptablename&gt;Emp_Target.</p><p>(ii)LookupPolicyonMultipleMismatch&gt;useFirstValue.</p><p>(iii)ConnectionInformation&gt;Oracle.</p><p>IntheConditionstab(i)ClickonAddanewcondition</p></li><li><p>5/14/2016 CompletereferencetoInformatica:SCDType1</p><p>http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 4/6</p><p>(ii)LookupTableColumnshouldbeEmpno,TransformationportshouldbeEmpno1andOperatorshould=.</p><p>ExpressionTransformation:AfterwearedonewiththeLookupTransformationweareusinganexpressiontransformationtocheckwhetherweneedtoinserttherecordsthesamerecordsorweneedtoupdatetherecords.ThestepstocreateanExpressionTransformationareshownbelow.</p><p>DragallthecolumnsfromboththesourceandthelookuptransformationanddropthemallontotheExpressiontransformation.NowdoubleclickontheTransformationandgotothePortstabandcreatetwonewcolumnsandnameitasinsertandupdate.BoththesecolumnsaregonnabeouroutputdatasoweneedtohavecheckmarkonlyinfrontoftheOutputcheckbox.TheSnapshotfortheEdittransformationwindowisshownbelow.</p><p>Theconditionthatwewanttoparsethroughouroutputdataarelistedbelow.</p><p>InputIsNull(EMPNO1)</p><p>Outputiif(Notisnull(EMPNO1)andDecode(SAL,SAL1,1,0)=0,1,0).</p><p>Wearealldonehere.ClickonapplyandthenOK.</p><p>FilterTransformation:wearegonnahavetwofiltertransformationsonetoinsertandothertoupdate.</p><p>ConnecttheInsertcolumnfromtheexpressiontransformationtotheinsertcolumninthefirstfiltertransformationandinthesamewaywearegonnaconnecttheupdatecolumnintheexpressiontransformationtotheupdatecolumninthesecondfilter.LaternowconnecttheEmpno,Ename,Salfromtheexpressiontransformationtobothfiltertransformation.Ifthereisnochangeininputdatathenfiltertransformation1forwardsthecompleteinputtoupdatestrategytransformation1andsameoutputisgonnaappearinthetargettable.Ifthereisanychangeininputdatathenfiltertransformation2forwardsthecompleteinputtotheupdatestrategytransformation2thenitisgonnaforwardtheupdatedinputtothetargettable.GotothePropertiestabontheEdittransformation</p><p>(i)Thevalueforthefiltercondition1isInsert.</p><p>(ii)Thevalueforthefiltercondition1isUpdate.</p><p>TheCloserviewofthefilterConnectionisshownbelow.</p></li><li><p>5/14/2016 CompletereferencetoInformatica:SCDType1</p><p>http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 5/6</p><p>UpdateStrategyTransformation:Determineswhethertoinsert,delete,updateorrejecttherows.</p><p>DragtherespectiveEmpno,EnameandSalfromthefiltertransformationsanddropthemontherespectiveUpdateStrategyTransformation.NowgotothePropertiestabandthevaluefortheupdatestrategyexpressionis0</p><p>(onthe1stupdatetransformation).NowgotothePropertiestabandthevaluefortheupdatestrategyexpressionis1</p><p>(onthe2ndupdatetransformation).Weareallsetherefinallyconnecttheoutputsoftheupdatetransformationstothetargettable.</p><p>Step3:CreatethetaskandRuntheworkflow.</p><p>Dontcheckthetruncatetableoption.ChangeBulktotheNormal.Runtheworkflowfromtask.</p><p>Step4:PreviewtheOutputinthetargettable.</p><p>PostedbyNaveenatSunday,April17,2011</p></li><li><p>5/14/2016 CompletereferencetoInformatica:SCDType1</p><p>http://informaticatutorialsnaveen.blogspot.in/2011/04/scdtype1.html 6/6</p><p>Nocomments:</p><p>PostaComment</p><p>Enteryourcomment...</p><p>Commentas: GoogleAccount</p><p>Publish Preview</p><p>Linkstothispost</p><p>CreateaLink</p></li></ul>