This tutorial covers the creation of metadata for access to analytic workspace data and the OLAP engine. You will use the Oracle BI Administrative Tool to create the required metadata.
Approximately 1 hour.
This tutorial covers the following topics:
| Overview | |
| Prerequisites | |
| Define the Physical Layer | |
| Define Additional Metadata to Leverage ETV Aggregations | |
| Specify a Complex Join on the Logical Tables | |
| Summary | |
| Related information |
Place
the cursor over this icon to load and view all
the screenshots for this tutorial. (Caution: This action loads all screenshots
simultaneously, so response time may be slow depending on your Internet connection.)
Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot associated with that step. You can hide an individual screenshot by clicking it.
At the highest level, the creation of metadata for BI EE 10g is a three-step process.
| 1. | First, you define a Physical layer, which identifies the source data. |
| 2. | Second, you define the Business Model and Mapping layer, which organizes the physical layer into logical categories and records the appropriate metadata for access to the source data. |
| 3. | Third, you define the Presentation layer, which exposes the business model entities for end-user access. |
In this lesson, you will define all three layers of metadata for access to the Global AW.
A completed repository for this lesson is available for download in the Related information section.
Before starting this tutorial, you should:
| |
Have successfully completed the following tutorial: Lesson 1: Preparing an Analytic Workspace for Access by Oracle BI EE 10g. |
The first step in defining BI EE 10g metadata for the AW is to import the embedded total view (ETV) into the Physical Layer. This step identifies the ETV as the data source though which the AW is accessed.
In this topic, you will (optionally) create an ODBC Data Source, import the ETV into the Physical Layer, and then test access to the imported data.
In order to define the Physical Layer for access to the AW, you must first have an ODBC Data Source defined. The first subtopic shows how to create an ODBC Data Source for the Oracle 10g database. If you already have the appropriate ODBC Data Source created, move to the second subtopic.
| Create an ODBC Data Source | ||
| Import the Embedded Total View | ||
| Test the Import | ||
In order to connect to an Oracle data source for purposes of metadata creation, the BI EE 10g Administration Tool uses an ODBC connection. If you have not yet created an ODBC Data Source for your Oracle 10g database, follow these steps.
Note: In this example, an ODBC Data Source for Microsoft Windows XP will be used.
| 1. | Click the Start button, and then select Settings > Control Panel.
|
| 2. | Double-click the Administrative Tools icon, and then the Data Sources (ODBC) icon.
|
| 3. | In the ODBC Data Sources Administrator, click the System DSN tab. The window should look something like this:
Click the Add button.
|
| 4. | In the Create New Data Source wizard, select the appropriate driver for the Oracle 10g database, and click Finish.
|
| 5. | In the Oracle ODBC Driver Configuration window, provide a name and description, specify the TNS service name, and enter global as the User ID.
Then, click the Test Connection button. Result: an Oracle ODBC Driver Connect window is displayed.
|
| 6. | In the Oracle ODBC Driver Connect window, enter global as the password, and click OK.
Result: If the test is succesful, the following window appears. If the test is unsuccesful, reenter the correct password.
|
| 7. | Click OK to close the Oracle ODBC Driver Connect window. The System DSN tab of the ODBC Data Source Administrator should now show the Oracle data source, like this:
|
| 8. | Click OK to close the Oracle Data Source Administrator. |
To import the ETV, perform the following steps.
| 1. | Open the Oracle BI Administration Tool. Hint: Using the Start menu, select Programs > Oracle Business Intelligence > Administration.
|
| 2. | In the Administration Tool, select File > New. In the New Repository window. Enter global.rpd as the file name and click Save. Result: a new repository named global.rpd is displayed.
|
| 3. | Select File > Import > from Database.
|
| 4. | In the Select Data Source window, click the Oracle DSN connection. The User Name field is automatically filled with "global".
Enter global as the password, and click OK.
|
| 5. | In the Import window, ensure that both the Tables and Views options are selected. Then, drill on the GLOBAL node, like this:
|
| 6. | Scroll down in the list of GLOBAL tables and view, select UNITS_CUBE_CUBEVIEW.
Click Import. Result: The Connection Pool window is displayed.
|
| 7. | In the Connection Pool window, ensure that the Default (OCI 10g) call interface is selected, and that the Data source name field is set to the TNS service name for your Oracle Database connection. In this example, the TNS service name is orcl. Hint: the service name is the same value that you specified when creating the ODBC Data Source connection.
Accept the other default settings and click OK. Once the import is finished, close the Import window.
|
After the import is complete, a new node appears in the Physical layer pane. To test access to the source data, preform the following steps.
| 1. | In the Physical layer pane, drill on the Oracle node, and then drill on the GLOBAL node. Result: the OLAP embedded total view is displayed as a node. Drill on the UNITS_CUBE_CUBEVIEW node to display the view's columns.
|
| 2. | Right-click on the CUSTOMER_LEVEL column and select View Data from the menu. The following window should be displayed.
Data is returned for the column, which confirms that the import worked correctly. Click Close. |
Creating busness model metadata for an OLAP data source is comprised of two phases. First, you define a business model in the typical way you would for any relational source. Then, you define additional metadata that leverages the OLAP embedded total view.
In this topic, you will define standard business model metadata, which includes the following steps:
| Create Logical Tables for a Star | ||
| Map Physical Layer columns to Business Model Objects | ||
| Enable Drilling by Dimension Level | ||
Create Logical Tables for a Star
Perform the following steps to create logical tables for the business model.
| 1. | First, create the Business Model object. Select the Business Model and Mapping pane, and then right-click in the white space. Select New Business Model from the menu.
In the Business Model - Global window, enter Global as the name, and click OK.
|
|||||||||
| 2. | Create a logical table for the measures by peforming the following steps:
A logical table named Facts is displayed:
|
|||||||||
| 3. | Create a logical table for the Channel dimension:
|
|||||||||
| 4. | Create a logical table for the Customer dimension:
|
|||||||||
| 5. | Create a logical table for the Product dimension:
|
|||||||||
| 6. | Create a logical table for the Time dimension:
The following logical tables should now be included in the business model:
|
|||||||||
In this topic, you will map columns from the Physical layer to the Business Model layer. Measures from the ETV will be mapped to the logical Fact table, and certain columns that describe the dimensions in the ETV will be mapped to the logical dimension tables.
For each logical dimension table, you will map the appropriate ETV description column for each hierarchical level, and also the "_LEVEL" column for that dimension. (The LEVEL column(s) describe the level of aggregation for a row).
| 1. | First, click the collapse (-) symbol next to each of the logical tables, so that the display looks like this:
Drag the COST column from the Physical layer pane to the Business Model pane and drop it on the logical Facts table, as shown here:
Result: A column named COST appears under the Facts table.
|
||||||||||||||||||||||||
| 2. | In the Physical layer pane, scroll down so that all of the columns that begin with "PROFIT" are displayed. Holding down the Shitt key, select all of the profit measures, like this:
Still holding down the Shift key, drag and drop the profit measures on the Facts table as before. Note: Drop the columns on the logical Facts table, and not on the Sources folder.
|
||||||||||||||||||||||||
| 3. | Using the same technique as above, select all of the columns that being with "SALES". Also select the UNITS column at the bottom of the Physical layer pane. As before, drag these measures to the Facts table. The Facts table should now contain the following columns:
Finally, set the Aggregation Rule for all measures to Sum. This aggregation rule assignment is performed so that BI EE recognizes the column as a measure. The data is already aggregated (in the AW or by the OLAP engine). In fact, this methodology produces results that 'aggregate' a single row, so that measures such as percentages will be correct. To assign the aggregation rule to all measures, perform the following:
The list of measures should look like this:
|
||||||||||||||||||||||||
| 4. | In the following order, drag these columns from the Physical layer pane to the logical Channel logical table: CHANNEL_TOTAL_CHAN_LVLDSC, CHANNEL_CHANNEL_LVLDSC, and CHANNEL_LEVEL. When you are done, the display should look like this:
Note: As stated previously, you map the level description columns for each dimension level, rather than the ID columns.
|
||||||||||||||||||||||||
| 5. | Next, rename the logical hierarchy level description columns as follows:
The logical Channel table should now look like this:
|
||||||||||||||||||||||||
| 6. | Next, map the columns for the Shipments hierarchy in the Customer dimension. As you may recall from the previous lesson, the Customer dimension has two hierarchies, as shown below.
Although both hiearchies can be added to the business model, you will map only the Shipments hierarchy, which is the default hierarchy in the AW. Recall from the previous lesson, that the description column for the lowest level ("Ship To") in the Shipments hierarchy is named CUSTOMER_SHIP_TO_LVLDSC1.
When you have completed 6.A and 6.B, the logical Customer table should look like this:
|
||||||||||||||||||||||||
| 7. | Next, map the columns for the Product dimension. Drag and then rename the following columns from the Physical pane to the logcial Product table, in the following order:
Then, drag the PRODUCT_LEVEL column from the Physical layer to the logical Product table. When you are done, the logical Product table should look like this:
|
||||||||||||||||||||||||
| 8. | Next, map the columns for the Time dimension. Drag and then rename the following columns from the Physical pane to the logcial Time table, in the following order:
Next, drag the TIME_LEVEL and TIME_END_DATE columns from the Physical layer to the logical Time table. Note: the TIME_END_DATE column will be used to specify the default sort order for the logical Month column. Otherwise, when you display Month columns in a report, they will be sorted using BI EE's default alphabetic sorting rule, like this: Q1 > Feb, Jan, Mar; Q2 > Apr, Jun, May; and so on. To specify the sort order for Month, first double-click on the logical Month column under the logical Time table. Then, in the Logical Column Window, click the Set button next to the Sort order column box. In the Browse window, select the TIME_END_DATE column and click OK.
The sort order column is set. Finally, click OK to close the Logical Column window. When you are done, the logical Time table should look like this:
|
||||||||||||||||||||||||
| 9. | Finally, assign a primary key for each logical dimension table.
The display should look like this:
|
||||||||||||||||||||||||
In this topic, you define additional metadata that enables drilling by dimemsion level.
First, define Dimension objects and their associated Level objects. Then, map the columns from the logical dimension tables to the associated dimension object levels.
| 1. | In the Business Model and Mapping pane, create a Dimension object for each of the logical "dimension" tables.
When you are finished, the Global business model should look like this:
|
|||||||||||||||||||||
| 2. | For each Dimension object, create Level objects that represent the dimension's hierarchical structure.
Notes: The top level for each dimension hierarchy is created using the technique described in 2.A - 2.B. Subsequent child level for all hierarchies are created using the technique descibed in 2.C - 2.D.
|
|||||||||||||||||||||
| 3. | Within the Business Model and Mapping pane, drag the columns from the logical tables to the associated dimension object levels. This provides the required mapping information for drilling purposes. Then, assign each dimension level column as a 'Logical Key'. For the Channel dimension, perform the following:
When the mapping and logical key assignments are complete, Channel Dim should look like this:
|
|||||||||||||||||||||
| 4. | Use the same mapping technique as described in step 3 to map all columns from the logical Customer table to the associated levels in the Customer Dim dimension object. Then, specify Logical Key status to each level column. When done mapping and specifying logical key assignments, the display should look like this:
|
|||||||||||||||||||||
| 5. | Use the same mapping technique as described in step 3 to map all columns from the logical Product table to the associated levels in the Product Dim dimension object. Then, specify Logical Key status to each level column. When done mapping and specifying logical key assignments, the display should look like this:
|
|||||||||||||||||||||
| 6. | Use the same mapping technique as described in step 3 to map all columns from the logical Time table to the associated levels in the Time Dim dimension object. Then, specify Logical Key status to each level column. When done mapping and specifying logical key assignments, the display should look like this:
|
|||||||||||||||||||||
Next, additional metadata is defined in the Business Model and Mapping layer. This additional metadata is required so that the following ideal OLAP query characteristics will apply to the generated SQL:
![]() |
Level conditions are applied to every dimension in the WHERE clause. |
|
![]() |
Level conditions are applied to lowest selected level for a dimension. For example, if “Year” and “Quarter” are both in a query, then the condition time_level=‘QUARTER’ is applied. | |
![]() |
An “All/Total Level” condition is applied to dimensions that are omitted from the SELECT statement. This is required in order to leverage cube aggregation. |
|
Queries that are tuned to leverage OLAP aggregations in this way will optimize performance. In addition, OLAP calculations on aggregate data occur in Oracle OLAP.
The following report illustrates the optimal SQL to leverage OLAP aggregations.
In the SQL query:
![]() |
Level conditions are applied to all four dimensions, even though only three dimensions are in the SELECT statement (Product, Customer, and Time). | |
![]() |
Level conditions are applied at the lowest selected level for each dimension in the query: FAMILY, REGION, and QUARTER. | |
![]() |
Since the channel dimension is omitted from the SELECT statement, the 'TOTAL_CHANNEL' level condition is automatically applied to the query for that dimension. |
|
To ensure that BI EE generates SQL which is optimized for OLAP, the following additional metadata creation tasks are required: (A) Make the logical dimension tables “Level-aware”, by setting up logical table sources for each dimension level; (B) Create a logical table and Dimension object that describe the dimension levels; and (C) Force the level conditions to be applied to every query, by utilizing BI EE security filters (which is conceptually similar to Oracle VPD policy).
To achieve the required query results, perform the following administrative tasks:
| Define a Table Source for Each Dimension Level | ||
| Create a Logical Table and a Dimension Object Describing Dimension Levels | ||
| Provide Filter Conditions for the Logical Dimension and Fact Tables | ||
Define a Table Source for Each Dimension Level
Currently, each logical dimension contains a single source. Now, you will create logical table sources for each level in the logical dimension.
Each level table source should contain mapping information that describes its source, and also the sources for parent levels above it within the dimension hierarchy. However, columns below the grain of the level should not be mapped.
In addition, each level table source will specify a literal value that describes its level within the hierarchy.
| 1. | First, create logical table sources for all of the levels in the logical Channel table. Then, modify the table sources as specified below. To begin, drill on the Sources folder under the logical Channel table. Then, right-click on the UNITS_CUBE_CUBEVIEW table source and select Duplicate from the menu. A second table source appears.
Since the Channel dimension only contains two levels, you have the number of table sources that you need. Modify the table sources as follows:
The logical Channel table should now look like this:
|
||||||||||||||||||
| 2. | Next, create logical table sources for the levels in the logical Customer table. Then, modify the table sources as specified below. As before, drill on the Sources folder under the logical Customer table. Then, use the same technique as step 1 to create three duplicates of the UNITS_CUBE_CUBEVIEW table source. When you are done, the following table sources should appear:
Use the techniques shown in steps 1.A - 1.E to complete the following modifications to the sources for the logical Customer table:
The logical Customer table should now look like this:
|
||||||||||||||||||
| 3. | Create logical table sources for all of the levels in the logical Product table. Then, modify the table sources as specified below. Since there are four levels in the Product hierarchy, create three duplicates of the original table source. As before, drill on the Sources folder under the logical Product table. Then select Duplicate from the right-mouse menu on the UNITS_CUBE_CUBEVIEW table source. When you are done, the following table sources should appear.
Next, use the techniques shown above to complete the following modifications to the sources for the logical Product table:
The logical Product table should now look like this:
|
||||||||||||||||||
| 4. | Create logical table sources for all of the levels in the logical Time table. Then, modify the table sources as specified below. Since there are four levels in the Time hierarchy, create three duplicates of the original table source. As before, drill on the Sources folder under the logical Time table. Then select Duplicate from the right-mouse menu on the UNITS_CUBE_CUBEVIEW table source. When you are done, the following table sources should appear.
Next, use the techniques shown above to complete the following modifications to the sources for the logical Time table:
The logical Time table should now look like this:
|
||||||||||||||||||
You have just finished making the logical dimension tables “Level-aware”, by setting up logical table sources for each dimension level.
However, you still need to add metadata that forces level conditions to be applied to every query in the WHERE clause. This is actually a two-part process, which includes:
| A. | Creating a Logical Table and a Dimension object that specifically describe the dimension levels. This part is covered in this topic. |
|
| B. | Provide filter conditions for each dimension, utilizing BI EE security filters. This part is covered in the next topic. | |
Follow these steps to create a Logical Table and a Dimension object that describe the dimension levels.
| 1. | Perform the following to create the “Dimension Levels” logical table:
The display looks like this:
|
||||||||||||||||||||||||
| 2. | Drag the following columns from the Physical Layer pane to the Dimension Levels logical table:
When done, the Dimension Levels logical table should look like this:
|
||||||||||||||||||||||||
| 3. | Double-click on the Dimension Levels logical table to display the Logcial Table - Dimension Levels window. In the Keys tab, click New. In the Logical Key dialog, select all of the Level columns, as shown below, and click OK.
Then, click OK in the Logical Table - Dimension Levels window. The display should now look like this:
|
||||||||||||||||||||||||
| 4. | Perform the following to create the Dimension object that describes the "_LEVEL" columns:
When you are done, the display should look like this:
|
||||||||||||||||||||||||
| 5. | In the previous topic, you defined table sources for each of the dimension levels. Now that you have created a Logical Table and a Dimension object that describe the dimension levels, you are ready to modify the table source for the logical Facts table, and the table source for the Dimension Levels table. In the Facts table source, you must specify the lowest hierarchical level as the Logical Level for each Dimension object. To do this, follow these instructions:
In the Dimension Levels source, you must specify the 'Detail' level as the Logical Level, as described here:
|
||||||||||||||||||||||||
Now, you will finish the task of enforcing appropriate level conditions for all queries by providing a specific filter condition for each logical dimension, and the logical Facts table, in the business model. The filter conditions will effectively “join” the logical dimension tables to the facts based on the level columns. The same filter condition will be applied to each of the logical tables.
The BI EE Security Filters feature will be used to create the required filters. A Security Filter is always assocated with a Security Group. However, since security filters are not applied to any user in the Administrators group, a new group must be created, and users of the Global repository must be assigned to this group.
| 1. | From the main menu, select Manage > Security. The Security Manager window appears.
|
|||||||||
| 2. | In the Security Manager window, select Action > New > Group. In the Group window, enter Global Users as the name, and then click Permissions.
|
|||||||||
| 3. | In the Permissions window, select the Filters tab and then click the Add button.
|
|||||||||
| 4. | In the Browse window, select the Business Model tab. Drill on the Global node then select all of the logical tables except Dimension Levels, as shown below. Then click the Select button.
Result: the Permissions window appears, like this:
|
|||||||||
| 5. | Next, click on the first elipses button (...) under the Business Model Filter column. The Expression Builder - Security Filter window is displayed.
|
|||||||||
| 6. | In the Expression Builder window, create the following filter:
Note: You can use the panes and operators at the bottom of the Expression Buider window to select and insert the appropriate logical columns and operators as you construct the filter. Once you have the filter complete, select the entire filter and copy it to the clipboard.
Then, click OK. The Permissions window now looks something like this:
|
|||||||||
| 7. | Paste the filter for each of the remaining logical tables by performing the following:
Repeat this process to complete the filter creation for all of the logical tables. When you are done, the Permissions window should look something like this:
This strategy ensures that the same filter will be applied when any one of these logical tables are selected by an end user.
|
|||||||||
| 8. | Click OK to close the Permissions window. Then click OK to close the Groups window.
|
|||||||||
| 9. | Now, you wil add a user to the Global Users group. Actual implementation should integrate Authentication and Authorization procedures as required. However, for the sake of simplicity, you will add a user to the Global Users group using the BI Administration tool. In the Security Manager window, select Action > New > User. In the User window, enter global as the user name and select the Global Users group.
Then, click OK. Finally, close the Security Manager window.
|
|||||||||
| 1. | Right-click on any one of the logical tables and select Business Model Diagram > Whole Diagram from the menu. The Logical Table Diagram window opens. Arrange the logical tables into a 'star', something like this:
|
|||||||||
| 2. | Create logical joins between the dimension tables (including the Dimension Levels table) and the Facts table by performing the following:
When you are done, the Logical Table Diagram window should something look like this:
|
|||||||||
| 3. | Close the Logical Table Diagram window. The Global business model should now look like this:
The Business Model is complete. |
|||||||||
In order for users to query the data in a tool such as BI Answers, you must define a Presenation layer, which organizes objects from the business model layer in a user-friendly format.
In the Presentation layer, columns should be orgainzed in such a ways as to make it easy for end-users to navigate the data that they want to access. In addition, you should only expose the logical columns which the users need in order to view data. For example, the Dimension Levels columns are of no value to the end user. The presentation of user-visible columns can be quite sophisitcated. However, here you will create a simple presentation catalog.
To define the Presenation layer for the Global business model, perform the following steps:
| 1. | Right-click in the Presentation pane and select New Presentation Catalog from the menu. In the Presentation Catalog window, enter Global as the name. By default, the Global business model is selected, as it is the only business model in this repository. Click OK to create the new Presentation catalog object.
|
|||||||||||||||||||||
| 2. | Drag the following logical tables over to the Global presentation catalog: Channel, Customer, Facts, Product, and Time.
|
|||||||||||||||||||||
| 3. | Perform the following modifications to the presentation tables:
Tthe Presentation pane should should now look like this:
|
|||||||||||||||||||||
| 4. | To ensure that no errors have been made, click the Save button, and select Yes when prompted to "Check for global consistency". If the metadata model is correct, the following message is displayed:
Click Yes. You are ready to move to the next lesson. Notes: If any errors are returned that refer to either the Business Model or Presenation Table in the Object Type column, correct these errors and then check global consistency again. Consistency check Warnings can be ignored. |
|||||||||||||||||||||
In this lesson, you've learned how to:
| Import the Embedded Total View into the Physical Layer. | ||
| Create the required Business Model metadata for access OLAP data in the ETV. | ||
| Create a Presentation catalog for end-user access. | ||
|
A completed repository zip file for this lesson can be downloaded from here. In the File Download window, click Save. Then, select the C:\OracleBI\server\Repository folder as the destination. |
|
| To learn more about Oracle Business Intelligence Enterprise Edition, refer to additional OBEs on the OTN Web site. From this page, select Business Intelligence Start > Oracle BI Enterprise Edition (EE-10.1.3.2) |