OWB试验手册4Word文档下载推荐.docx
《OWB试验手册4Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《OWB试验手册4Word文档下载推荐.docx(56页珍藏版)》请在冰豆网上搜索。
2.
YoudesignamappinginWarehouseBuilderusingtheMappingEditorinterface.Asyoudesignamapping,youselectoperatorsfromtheMappingEditorPalettepanelandplacethemonthecanvas.
Tip:
Ifyouarenotabletoseealltheobjectssimilartothefollowingscreenshot,thenintheMappingEditor,clickAuto-Layout
onthetoolbartobringthemappingtoitsdefaultsize.Maximizetheoperatorsonthecanvasbyclickingthemaximizeicon
.
IntheMappingEditor,youseethefollowingoperatorsonthecanvas:
a)ATableoperatornamedCHANNELS_IN
b)AConstantoperatornamedTOTALS
c)ADimensionoperatornamedCHANNELS_OUT
d)Connectionlinesbetweenattributes
3.
IntheLOAD_CHANNELSmapping,clickthetableoperatorCHANNELS_INheader.Thisnowbecomesthecurrentlyselectedobject.Right-clickthetableoperatorCHANNELS_INheaderandselectOpenDetails.ThislaunchestheOperatorEditorintabformat.
Eachtabhelpsinperformingtasksassociatedwiththeoperator.Forexample,theNametabenablesyoutospecifyanameandoptionaldescriptionfortheoperator.
ClickCanceltocloseTableEditor.
4.
IntheLOAD_CHANNELSmapping,ensurethattheCHANNELS_INtableoperatorisselected.(ClickthetableoperatorCHANNELS_INheader.)Todeterminetheoperator'
sboundname,scrolldowntotheBoundNamepropertiesintheTableOperatorPropertiespanel.ThisoperatorisboundtotheCHANNELStableintheXSALESschema.
Alternatively,moveyourmouseovertheheaderoftheoperator.Iftheoperatoriscurrentlybound,youwillseethecompletedetailsinthefollowingformat:
Operator<
operatorname>
:
boundto/<
projectname>
/modulename/operatorboundname(forexample,OperatorCHANNELS_IN:
boundto/OWB_DEMO/XSALES/CHANNELS).
Note:
Boundnameisthephysicalnameoftheobjectthatisconnectedtoanobjectoperatorinamapping.Boundnamesareusedtoreferencetheobjectduringcodegeneration.
5.
IntheLOAD_CHANNELSmapping,thedimensionoperatorisnamedCHANNELS_OUT.TheoperatorisboundtotheCHANNELSdimensionintheSALES_WHtargetschema.
6.
IntheLOAD_CHANNELSmapping,theconstantoperatorisnamedTOTALS.TheConstantoperatorenablesyoutodefineconstantvalues.Constantscanbeusedanywhereinamapping.TheConstantoperatorproducesasingleoutputgroupthatcancontainoneormoreconstantattributes.ToaddaConstantoperatoronthecanvas,youshoulddragaconstantoperatorfromthePalette.
Anexampleofusingaconstantoperatoristoloadthevalueofthecurrentsystemdateintoatableoperator.
ToaddtheattributestotheTOTALSconstantobject,right-clicktheconstantoperatorTOTALSheaderandselectOpenDetails.ClicktheOutputAttributestab.ClickingAddwilladdattributestotheTotalsconstantobject.Asyouseeinthescreenshottwoattributeshavebeenadded.
ClickCanceltoclosetheConstanteditor.
7.
IntheLOAD_CHANNELSmapping,selecttheTOTattributebyselectingtheTOTattributeintheTOTALSconstantoperator.OntheleftintheMappingEditor,intheAttributePropertiespanel,inspecttheExpressionproperty.IntheAttributePropertiespanel,clickthefieldnexttotheExpressionproperty.Clickthe
buttonontheright.TheExpressionBuilderislaunched.ThevalueoftheTOTattributeis"
ChannelsTotal."
ClosetheExpressionEditor.
8.
IntheLOAD_CHANNELSmapping,youseeconnectionlinesfrom:
∙AttributesinthetableoperatorCHANNELS_INtoattributesinthedimensionoperatorCHANNELS_OUT
∙AttributesintheconstantoperatorTOTALStoattributesinthedimensionoperatorCHANNELS_OUT
Inthisexample,youconnectoperatorsbyconnectingindividualoperatorattributestoeachother.Connectionlinesgraphicallyrepresenthowthedataflowsfromasource,throughoperators,andtoatarget.
ClosetheMappingEditor.
(二)、DesignaMappingBetweenanExternalTableandaDimension
Inthissubtopic,youperformahands-onexercisetocreatetheREL_CATEGORY_MAPmappingthatmapsanexternaltablecalledEXPENSE_CATEGORIES_CSVtoadimensioncalledREL_CATEGORY.
IntheProjectExplorer,expandOWB_DEMO.ExpandDatabases>
EXPENSE_WH>
Mappings.
NotethatyouseeaREL_TIME_MAPmapping,whichwasautomaticallycreatedbyOWBwhenyoucreatedthetimedimensionREL_TIMEusingtheTimeWizard.
Right-clickMappingsandselectNew.
TheCreateMappingwindowappears.
IntheCreateMappingwindow,enterREL_CATEGORY_MAPasnameofthemapping.ClickOK.
IntheProjectExplorerpanel,youseeanentryfortheREL_CATEGORY_MAPmappingundertheEXPENSE_WHmodule.TheMappingEditorlaunchestheREL_CATEGORY_MAPmapping.
FromthePalette,dragtheDimensionoperatortothecanvas.TheAddDimensionOperatorwindowappears.
IntheAddDimensionOperatorwindow,navigatetotheEXPENSE_WHmoduleandselecttheREL_CATEGORYdimension.ClickOK.
TheREL_CATEGORYdimensionobjectisdroppedonthecanvas.
Alternatively,youcanaddexistingsourcesandtargetstoamappingthroughtheExplorerpanel,whichisontheleftsideoftheMappingEditor.IntheExplorerpanel,ensurethatAvailableobjectstabisselected.ExpandOracle>
ExternalTables.DragEXPENSE_CATEGORIEStothecanvas.
Nowtherearetwoobjectsonthecanvas,theEXPENSE_CATEGORIESexternaltableandtheREL_CATEGORYdimension.
IntheMappingEditor,clickAuto-Layout
onthetoolbartochangethemappingtoitsdefaultsize.Bydragging,movetheEXPENSE_CATEGORIESexternaltabletotheleftoftheREL_CATEGORYdimension.MaximizetheEXPENSE_CATEGORIESexternaltablebyclickingthemaximizeicon
.Similarly,maximizetheREL_CATEGORYdimension.
Connectthesource(EXPENSE_CATEGORIESexternaltable)tothetarget(REL_CATEGORYdimension)asfollows:
∙DragaconnectionlinefromEXPENSE_CATEGORIES.OUTGRP1.EXPENSE_TYPEtoREL_CATEGORY.TYPE.NAME
∙DragaconnectionlinefromEXPENSE_CATEGORIES.OUTGRP1.EXPENSE_TYPEtoREL_CATEGORY.TYPE.DESCRIPTION
∙DragaconnectionlinefromEXPENSE_CATEGORIES.OUTGRP1.EXPENSE_CATEGORYtoREL_CATEGORY.CATEGORY.NAME
∙DragaconnectionlinefromEXPENSE_CATEGORIES.OUTGRP1.EXPENSE_CATEGORYtoREL_CATEGORY.CATEGORY.DESCRIPTION
∙DragaconnectionlinefromEXPENSE_CATEGORIES.OUTGRP1.EXPENSE_CATEGORYtoREL_CATEGORY.TYPE.CATEGORY_NAME.
Connectionlinesgraphicallyrepresenthowthedataflowsfromasource,throughoperators,andtoatarget.
Youhavejustcompleteddesigningthemapping.Nowgetreadytogeneratethecodeforthemapping.IntheMappingEditor,fromthemenu,selectMapping>
Generate.Youhavenowgeneratedthecodethatloadsthedimension.BasedontheETLlogicthatyoudesigninamapping,WarehouseBuildergeneratesthecoderequiredtoimplementyourdesign.
TheGenerationResultswindowisdisplayed.TheGenerationResultswindowdisplaysthecodethathasbeengeneratedforyou.
ClosetheMappingEditor.
●DesignaMappingBetweenanExternalTableandaCube
Inthissubtopic,youperformahands-onexercisetocreatetheREL_EXPENSE_MAPmappingthatmapsanEXPORT_CSVexternaltabletoaREL_EXPENSEcube.
Mappings.Right-clicktheMappingsnodeandselectNew.
IntheCreateMappingwindow,enterREL_EXPENSE_MAPasthenameofthemapping.ClickOK.
IntheProjectExploreryouseeanentryfortheREL_EXPENSE_MAPmappingundertheEXPENSE_WHmodule.TheMappingEditorislaunched.
IntheExplorerpanel,ontheleftoftheMappingEditor,ensurethattheAvailableobjectstabisselected.ExpandOracle>
ExternalTables.DragtheEXPENSE_DATAexternaltabletothecanvas.
TheEXPENSE_DATAexternaltableobjectisonthecanvas.
IntheExplorerpanel,ensurethattheAvailableobjectstabisselected.ExpandOracle>
Cubes.DragtheREL_EXPENSEcubetothecanvas.
Now,therearetwoobjectsonthecanvas,theEXPENSE_DATAexternaltableoperatorandtheREL_EXPENSEcubeoperator.
onthetoolbartobringthemappingtoitsdefaultsize.
EnsurethattheEXPENSE_DATAexternaltableoperatoristotheleftoftheREL_EXPENSEcubeoperator.MaximizetheEXPENSE_DATAexternaltablebyclickingthemaximize
icon.Inthesameway,maximizetheREL_EXPENSEcubeoperator.
IntheMappingEditor,fromthePalettepanel,dragtheExpressionoperatortothecanvas.
表达式的作用主要是将EXPENSE_DATA外部表中列EXPENSE_DATA从一个日期属性转换为一个数值类型
DragaconnectionlinefromEXPENSE_DATA.OUTGRP1.EXPENSE_DATEtoEXPRESSION.INGRP1.
Right-clicktheexpressionoperatorEXPRESSIONheaderandselect
OpenDetails.
IntheExpressionEditor,clicktheOutputAttributestab.ClickAdd.
9.
RenametheOUTPUT1attributetoEXPENSE_DATE.EnsurethatthedatatypeisNUMBER.ClickOK.
10.
IntheMappingEditor,clicktheexpressionoperatorEXPRESSIONheader,andselectOUTGRP1.EXPENSE_DATE.IntheAttributePropertiespanel,clickthefieldnexttotheExpressionproperty.Clickthe
buttonontheright.
TheExpressionBuilderislaunched.
11.
IntheExpressionBuilder,enterthefollowingstatementinExpressionforEXPRESSION:
TO_NUMBER(TO_CHAR(INGRP1.EXPENSE_DATE,'
YYYYMMDD'
),'
9999