数据仓库DataWarehouse:Fundamental&Technology第四章操作型数据存储OperationalDataStore第四章操作型数据存储4.1概述4.2什么是ODS?4.3OLTP-ODS-DW体系结构4.4ODS的创建4.5ODS实例4.6小结4.1概述数据仓库的主要贡献明确提出数据处理的两种不同类型:操作型处理,OLTP分析型处理,DSS将两种处理在实现中区分开来建立起OLTP-DW两层数据存储体系解决数据集成的问题TheArchitectedEnvironmentDataWarehouseMostgranularTimevariantIntegratedSubjectorientedSomesummaryDepartmentalParochialSomederivedSomeprimitiveTypicaldepartmentsIndividualTemporaryAdhocHeuristicNon-repetitivePC,workstationbasedOperationalDetailedDaytodayCurrentvaluedHighprobabilityofaccessApplicationoriented存在问题在很多情况下,OLTP-DW的两层体系结构并不能涵盖企业所有的数据处理要求。因为企业的数据处理虽然可以较为粗略地划分成操作型和分析型两部分,但有时,这两种处理之间并没非常明晰的界限。实际的数据处理往往是多层次的。也就是说,有些处理是操作型的,但不适合在操作型DB中进行,而又存在着一些分析型处理,但不适合在DW中进行。实例决策环境商场决策人销售部门的中下层管理人员决策问题某商品是否要进货?决策所需掌握的情况需要掌握以下信息储备是否充足?该商品近期销售情况如何?资金情况如何?其他商品的库存情况和销售情况如何?即要综合了解这些信息,才能做较为合理、可行的决策。在何处实现这些功能?方法1:放到分散的OLTP系统中去做不一定能得到每个部门的准确的一致信息,需要进行部门间的协调配合,工作量会很大。方法2:将其放在数据量巨大的DW中去处理显然会较费时,可能涉及许多不必要的数据检索。这类决策的特点特点不是在线事务处理也算不上是高层决策分析。属于日常管理和控制的决策问题企业中层的管理者经常要解决的、较大量的问题。前述两种解决方法都不太可行,该如何解决?另一种数据环境这种信息处理的特点引出了一种数据环境ODS,operationaldatastore操作型数据存储它是在OLTP-DW两层体系结构的基础上再增加一个层次ODS,从而形成OLTP-ODS-DW的三层数据存储体系。图示OperationalOLTPODSODSApplicationDataWarehouseDWApplication中间层次ODS中的数据内容两类数据一方面,它包含企业全局一致的、细节的、当前或接近当前的数据,可以进行全局在线操作型处理;另一方面,它又是一种面向主题、集成的数据环境,且数据量较小,适合于辅助企业完成日常决策的数据分析处理。第四章操作型数据存储4.1概述4.2什么是ODS?4.3OLTP-ODS-DW体系结构4.4ODS的创建4.5ODS实例4.6小结4.2什么是ODS4.2.1ODS的定义及其特点4.2.2ODS的功能与实现机制4.2.1ODS的定义及其特点定义ODS是用于支持企业日常的全局应用的数据集合保存在ODS中的数据具有四个基本特点面向主题集成的可变的数据是当前或接近当前的关于ODS因为数据面向主题,要求ODS中的数据在企业级上应该保持高度的一致性,所以必须对进入ODS数据进行转换和集成。区别于与分散在各个OLTP应用的数据:面向主题、集成化。区别与DW中的数据存放当前数据或接近当前的数据可以进行在线修改ReferenceMaterialsFourClassODSesFourclassesofODSFromthebeginning,itwaspredictedthattherewouldbedifferentclassesofODSsbasedonhowfastdatawasloadedintotheODSandthesourceoftheload.ItwaspredictedthattherewouldbefourclassesofODSs:ClassI.TransactionsweremovedtotheODSinanimmediatemannerfromapplications-inarangeofonetotwosecondsfromthemomentthetransactionwasexecutedintheoperationalenvironmentuntilthetransactionarrivedattheODS.Inthiscase,theendusercouldhardlytellthedifferencebetweenanactivitythathadoccurredintheoperationalenvironmentandthesameactivityasitwastransmittedintheODSenvironment.ClassII.ActivitiesthatoccurredintheoperationalenvironmentwerestoredandforwardedtotheODSeveryfourhoursorso.Inthiscase,therewasanoticeablelagbetweentheoriginalexecutionofthetransactionandthereflectionofthattransactionintheODSenvironment.However,thisclassofODSwasmucheasiertobuildandtooperatethanaClassIODS.ClassIII.ThetimelagbetweenexecutionintheoperationalenvironmentandreflectionintheODSisovernight.InaClassIIIODSthereisanoticeabletimelagbetweentheexecutionofthetransactionintheoperationalenvironmentandthereflectionofthetransactionintheODSenvironment.ThistypeofODSisrelativelyeasytobuild.ClassIV.AClassIVODSisonethatisfedfromthedatawarehousefromanalysiscreatedbytheDSSanalystinthedatawarehouseenvironmentandcondenseddowntoapointwheretheresultsoftheanalyticalprocessingfitcomfortablyintheODS.TheinputtotheODScanbeeitherregularorirregular.ThisclassofODSisveryeasytobuildaslongasthedatawarehousehasalreadybeenconstructed.AclassIVODSisonewheretheODSisfedfromanalysisdoneonthedatawarehouse.Thedecisionsupportanalystcreatestheanalysisandsynthesizesthedata.Oncesynthesized,thedataisfedintotheODSfromthedatawarehouse.AclassIVODSisquiteusefulforgettingtheresultsofthedatawarehouseprocessingclosetothecustomer.SinceonlineresponsetimeisnotanormalfunctionofthedatawarehousebutisanormalfunctionfortheODS,theODSservesastheperfectvehiclefortakingDSSdatawarehouseanalysisanddeliveringittothecustomer.ConclusionAsarule,ClassIODSsarerare.ThenormalcaseforanODSisatypeII,IIIorIV.ClassIODSsaredifficulttoconstructandevenmoredifficulttooperate.ThereneedstobeaverystrongbusinesscaseforaClassIODS.ReferenceMaterialsWhat’sODS?What’sODS?Anoperationaldatastore(ODS)isatypeofdatabaseoftenusedasaninterimareaforadatawarehouse.Unlikeadatawarehouse,whichcontainsstaticdata,thecontentsoftheODSareupdatedthroughthecourseofbusinessoperations.Forwhat?AnODSisdesignedtoquicklyperformrelativelysimplequeriesonsmallamountsofdata(suchasfindingthestatusofacustomerorder),ratherthanthecomplexqueriesonlargeamountsofdatatypicalofthedatawarehouse.DifferencefromDWAnODSissimilartoyourshorttermmemoryinthatitstoresonlyveryrecentinformation;incomparison,thedatawarehouseismorelikelongtermmemoryinthatitstoresrelativelypermanentinformation.ClassIIIIntheearly1990s,theoriginalODSsystemsweredevelopedasareportingtoolforadministrativepurposes.Theywereusuallyupdateddailyandprovidedreportsaboutbusinesstransactionsforthatday,suchassalestotalsorordersfilled.ThistypeofsystemisnowreferredtoasaClassIIIODS.ClassIIWithchangesintechnologyandbusinessneeds,theClassIIODSevolvedtotrackmorecomplexinformationsuchasproductandlocationcodes,andtoupdatethedatabasemorefrequently(perhapshourly)toreflectchanges.ClassIClassIODSsystemsarosefromthedevelopmentofcustomerrelatio