1、2.You design a mapping in Warehouse Builder using the Mapping Editor interface. As you design a mapping, you select operators from the Mapping Editor Palette panel and place them on the canvas. Tip: If you are not able to see all the objects similar to the following screenshot, then in the Mapping E
2、ditor, click Auto-Layout on the toolbar to bring the mapping to its default size. Maximize the operators on the canvas by clicking the maximize icon . In the Mapping Editor, you see the following operators on the canvas:a) A Table operator named CHANNELS_IN b) A Constant operator named TOTALSc) A Di
3、mension operator named CHANNELS_OUTd) Connection lines between attributes3.In the LOAD_CHANNELS mapping, click the table operator CHANNELS_IN header. This now becomes the currently selected object. Right-click the table operator CHANNELS_IN header and select Open Details. This launches the Operator
4、Editor in tab format. Each tab helps in performing tasks associated with the operator. For example, the Name tab enables you to specify a name and optional description for the operator.Click Cancel to close Table Editor.4.In the LOAD_CHANNELS mapping, ensure that the CHANNELS_IN table operator is se
5、lected. (Click the table operator CHANNELS_IN header.) To determine the operators bound name, scroll down to the Bound Name properties in the Table Operator Properties panel. This operator is bound to the CHANNELS table in the XSALES schema. Alternatively, move your mouse over the header of the oper
6、ator. If the operator is currently bound, you will see the complete details in the following format: Operator : bound to /module name/operator bound name (for example, Operator CHANNELS_IN: bound to /OWB_DEMO/XSALES/CHANNELS).Note: Bound name is the physical name of the object that is connected to a
7、n object operator in a mapping. Bound names are used to reference the object during code generation. 5.In the LOAD_CHANNELS mapping, the dimension operator is named CHANNELS_OUT. The operator is bound to the CHANNELS dimension in the SALES_WH target schema.6.In the LOAD_CHANNELS mapping, the constan
8、t operator is named TOTALS. The Constant operator enables you to define constant values. Constants can be used anywhere in a mapping. The Constant operator produces a single output group that can contain one or more constant attributes. To add a Constant operator on the canvas, you should drag a con
9、stant operator from the Palette. An example of using a constant operator is to load the value of the current system date into a table operator.To add the attributes to the TOTALS constant object, right-click the constant operator TOTALS header and select Open Details. Click the Output Attributes tab
10、. Clicking Add will add attributes to the Totals constant object. As you see in the screenshot two attributes have been added.Click Cancel to close the Constant editor. 7.In the LOAD_CHANNELS mapping, select the TOT attribute by selecting the TOT attribute in the TOTALS constant operator. On the lef
11、t in the Mapping Editor, in the Attribute Properties panel, inspect the Expression property. In the Attribute Properties panel, click the field next to the Expression property. Click the button on the right. The Expression Builder is launched. The value of the TOT attribute is Channels Total. Close
12、the Expression Editor.8.In the LOAD_CHANNELS mapping, you see connection lines from: Attributes in the table operator CHANNELS_IN to attributes in the dimension operator CHANNELS_OUT Attributes in the constant operator TOTALS to attributes in the dimension operator CHANNELS_OUT In this example, you
13、connect operators by connecting individual operator attributes to each other. Connection lines graphically represent how the data flows from a source, through operators, and to a target.Close the Mapping Editor.(二)、Design a Mapping Between an External Table and a DimensionIn this subtopic, you perfo
14、rm a hands-on exercise to create the REL_CATEGORY_MAP mapping that maps an external table called EXPENSE_CATEGORIES_CSV to a dimension called REL_CATEGORY. In the Project Explorer, expand OWB_DEMO. Expand Databases EXPENSE_WH Mappings. Note that you see a REL_TIME_MAP mapping, which was automaticall
15、y created by OWB when you created the time dimension REL_TIME using the Time Wizard. Right-click Mappings and select New.The Create Mapping window appears.In the Create Mapping window, enter REL_CATEGORY_MAP as name of the mapping. Click OK.In the Project Explorer panel, you see an entry for the REL
16、_CATEGORY_MAP mapping under the EXPENSE_WH module. The Mapping Editor launches the REL_CATEGORY_MAP mapping. From the Palette, drag the Dimension operator to the canvas. The Add Dimension Operator window appears. In the Add Dimension Operator window, navigate to the EXPENSE_WH module and select the
17、REL_CATEGORY dimension. Click OK.The REL_CATEGORY dimension object is dropped on the canvas.Alternatively, you can add existing sources and targets to a mapping through the Explorer panel, which is on the left side of the Mapping Editor. In the Explorer panel, ensure that Available objects tab is se
18、lected. Expand Oracle External Tables. Drag EXPENSE_CATEGORIES to the canvas. Now there are two objects on the canvas, the EXPENSE_CATEGORIES external table and the REL_CATEGORY dimension. In the Mapping Editor, click Auto-Layout on the toolbar to change the mapping to its default size. By dragging,
19、 move the EXPENSE_CATEGORIES external table to the left of the REL_CATEGORY dimension. Maximize the EXPENSE_CATEGORIES external table by clicking the maximize icon . Similarly, maximize the REL_CATEGORY dimension.Connect the source (EXPENSE_CATEGORIES external table) to the target (REL_CATEGORY dime
20、nsion) as follows: Drag a connection line from EXPENSE_CATEGORIES.OUTGRP1.EXPENSE_TYPE to REL_CATEGORY.TYPE.NAME Drag a connection line from EXPENSE_CATEGORIES.OUTGRP1.EXPENSE_TYPE to REL_CATEGORY.TYPE.DESCRIPTION Drag a connection line from EXPENSE_CATEGORIES.OUTGRP1.EXPENSE_CATEGORY to REL_CATEGOR
21、Y.CATEGORY.NAME Drag a connection line from EXPENSE_CATEGORIES.OUTGRP1.EXPENSE_CATEGORY to REL_CATEGORY.CATEGORY.DESCRIPTION Drag a connection line from EXPENSE_CATEGORIES.OUTGRP1.EXPENSE_CATEGORY to REL_CATEGORY.TYPE.CATEGORY_NAME. Connection lines graphically represent how the data flows from a so
22、urce, through operators, and to a target.You have just completed designing the mapping. Now get ready to generate the code for the mapping. In the Mapping Editor, from the menu, select Mapping Generate. You have now generated the code that loads the dimension. Based on the ETL logic that you design
23、in a mapping, Warehouse Builder generates the code required to implement your design.The Generation Results window is displayed. The Generation Results window displays the code that has been generated for you. Close the Mapping Editor. Design a Mapping Between an External Table and a CubeIn this sub
24、topic, you perform a hands-on exercise to create the REL_EXPENSE_MAP mapping that maps an EXPORT_CSV external table to a REL_EXPENSE cube. Mappings. Right-click the Mappings node and select New. In the Create Mapping window, enter REL_EXPENSE_MAP as the name of the mapping. Click OK.In the Project E
25、xplorer you see an entry for the REL_EXPENSE_MAP mapping under the EXPENSE_WH module. The Mapping Editor is launched.In the Explorer panel, on the left of the Mapping Editor, ensure that the Available objects tab is selected. Expand Oracle External Tables. Drag the EXPENSE_DATA external table to the
26、 canvas. The EXPENSE_DATA external table object is on the canvas. In the Explorer panel, ensure that the Available objects tab is selected. Expand Oracle Cubes. Drag the REL_EXPENSE cube to the canvas.Now, there are two objects on the canvas, the EXPENSE_DATA external table operator and the REL_EXPE
27、NSE cube operator. on the toolbar to bring the mapping to its default size.Ensure that the EXPENSE_DATA external table operator is to the left of the REL_EXPENSE cube operator. Maximize the EXPENSE_DATA external table by clicking the maximize icon. In the same way, maximize the REL_EXPENSE cube oper
28、ator.In the Mapping Editor, from the Palette panel, drag the Expression operator to the canvas.表达式的作用主要是将EXPENSE_DATA外部表中列EXPENSE_DATA从一个日期属性转换为一个数值类型Drag a connection line from EXPENSE_DATA.OUTGRP1.EXPENSE_DATE to EXPRESSION.INGRP1.Right-click the expression operator EXPRESSION header and select Op
29、en Details. In the Expression Editor, click the Output Attributes tab. Click Add. 9.Rename the OUTPUT1 attribute to EXPENSE_DATE. Ensure that the data type is NUMBER. Click OK.10.In the Mapping Editor, click the expression operator EXPRESSION header, and select OUTGRP1.EXPENSE_DATE. In the Attribute Properties panel, click the field next to the Expression property. Click the button on the right. The Expression Builder is launched.11.In the Expression Builder, enter the following statement in Expression for EXPRESSION:TO_NUMBER(TO_CHAR(INGRP1.EXPENSE_DATE , YYYYMMDD), 9999
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1