Dimensional design using Oracle Warehouse Builder

Dimensional design using Oracle Warehouse Builder

Oracle Warehouse Builder is the only tool that supports dimensional design. Warehouse Builder provides wizards and editors to define and maintain the definitions. In this lesson you will learn how to inspect, and define dimensional objects within a warehouse target module using the editors and wizards.

Topics

This lesson will discuss the following:

Overview
Prerequisites
Inspecting Time Dimension

Creating the Warehouse Dimension

Examine the SALES cube in the cube editor
Creating the INVENTORIES cube
Summary

This lesson will take approximately 45 minutes to complete.

Move your mouse over this icon to show all screenshots. You can also move your mouse over each individual icon to see only the screenshot associated with it.


Overview

This lesson will teach you how to use the dimensional design capabilities of Oracle Warehouse Builder. In Warehouse Builder, dimensional design takes place in the context of an Oracle database target module. In this lesson you will begin with examining the TIME dimension, which is shipped along with Oracle Warehouse Builder. You will see how quickly and ease it is to create a dimension and a cube. You will create a WAREHOUSE dimension and an INVENTORIES cube.

Back to Topic List

Back to Topic List

In order for this lesson to work successfully, you will need to have performed the following:

1.

Completed Overview lesson.

2.

Completed Logging in to OWB lesson

 

Inspecting Time Dimensions

Back to Topic List

In this topic, you will examine the T_TIME dimension. The TIME dimension fulfills all the criteria's that OLAP eventually requires.

1.

In the OWB10g_DEMO project, expand the Databases node, expand the Oracle node, expand the WH target module and expand the Dimensions node.

Move your mouse over this icon to see the image

 

2.

Select the T_TIME dimension definition. Right click on T_TIME dimension and select Editor.

Move your mouse over this icon to see the image

Oracle Warehouse Builder ships a pre-defined time dimension that is fully compatible with a time dimension that an OLAP system requires.

 

3.

The Dimension Editor pops up with the time dimension. Click on the L_YEAR level to see the level attributes (use the little downward shape arrow on the right of the level L_YEAR).

Move your mouse over this icon to see the image

When the L_YEAR level is expanded you see the arrow is now changed to an upward shaped arrow. Click on the arrow to collapse the level.

 

4.

In the Dimension Editor, from the menu select Edit > Object Properties. The Dimension Properties window pops up.

Move your mouse over this icon to see the image

Examine the different tabs, Name showing the name and description, Levels shows all the levels created for the dimension, Level attributes shows the attributes or level columns, similar to columns in a table, Hierarchies and Level Relationships. Close the property sheet by clicking Cancel.

Move your mouse over this icon to see the image

 

5.

Warehouse Builder automatically implements a star schema. In the Dimension Editor, select Edit menu, select Table Properties and see how the dimension will be created in a relational environment.

Click on the various tabs, Name showing the name and description for the table, Column, contains the names of the columns in the table, Constraints and Attribute Sets. Click Cancel to close the Table properties window.

Move your mouse over this icon to see the image

Close the Dimension Editor.

 

 

 

Creating the Warehouse Dimension

Back to Topic List

After examining the pre-defined TIME dimension, you will learn how to create a dimension WAREHOUSE that contains a hierarchy COUNTRY - LOCATION - WAREHOUSE. The wizard will guide you through the process of creating a dimension.

Creating and naming the Dimension
Defining Levels
Defining Level Attributes
Defining a Hierarchy of Levels

Generating the Dimension and Examining the code


Creating and naming the Dimension

Back to SubTopic List

1.

Expand the OWB10g_DEMO project, expand Databases, and expand the Oracle node. Expand WH target module and select the Dimensions node.

Right click the Dimensions node and select Create Dimension.

Move your mouse over this icon to see the image

 

2.

Click Next on the New Dimension Wizard: Welcome page.

The New Dimension Wizard: Name page appears. Enter WAREHOUSE as name for the dimension, and WRE as the prefix. The prefix is used to identify the dimension and used to name unique keys and level attributes.

Click Next to move to the next step of defining levels for the WAREHOUSE dimension.

Move your mouse over this icon to see the image

 

Defining Levels

Back to SubTopic List

After you name the dimension you will learn how to create levels for a dimension. Using the New Dimensions Wizard: Level page you will create three levels COUNTRY, LOCATION and WAREHOUSE.

1.

The New Dimension Wizard: Levels page appears.

To define the first level COUNTRY: Type COUNTRY as the level name, CTY as the prefix. Click Add.

Move your mouse over this icon to see the image

On clicking Add the level COUNTRY appears on the right-hand side.

Move your mouse over this icon to see the image

 

2.

To define the second level LOCATIONS. In the New Dimensions Wizard: Levels page, type LOCATIONS as the level name, LCN as the prefix. Click Add.

Move your mouse over this icon to see the image

On clicking Add the level LOCATIONS appears on the right-hand side below COUNTRY.

Move your mouse over this icon to see the image


3.

To define the third level WAREHOUSE. In the New Dimensions Wizard: Levels page, type WAREHOUSE as the level name, WRE as the prefix. Click Add.

Move your mouse over this icon to see the image

 

 

4 .

All the three levels COUNTRY, LOCATIONS and WAREHOUSE appears on the right-hand side.

Click Next to move to the next step of defining level attributes for the levels created.

Move your mouse over this icon to see the image

 

Defining Level Attributes

Back to SubTopic List

After you defined the levels, the next step is to create the level attributes. Using the New Dimension Wizard you will continue to learn how to add attributes to the different levels. For every level you have one pre-defined attribute named ID, default datatype is number. You will edit the ID level attribute if the datatype is other than number.

1.

You can use this chart as a lookup for understanding the level attributes for each level.

Move your mouse over this icon to see the image

 

2.

In the New Dimension Wizard: Level Attributes page, from the level drop-down box select WAREHOUSE. You see the pre-defined attribute ID. Make no change to it.

Move your mouse over this icon to see the image

The WAREHOUSE level has two level attributes ID and NAME. To create a new attribute NAME: Type NAME as the name for the level attribute, select VARCHAR2 from the data type drop down list box and type 35 for length. Click Add.

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image

 

3 .

In the New Dimension Wizard: Level Attributes page, select LOCATION from the level drop-down.

Move your mouse over this icon to see the image

You see the pre-defined attribute ID. Make no change to it.

Move your mouse over this icon to see the image

The LOCATION level has three level attributes, ID, CITY, STATE_PROVINCE.

To create a new attribute CITY: Type CITY as the name for the level attribute, select VARCHAR2 from the data type drop down list box and type 30 for length. Click Add.

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image

To create a new attribute STATE_PROVINCE: Type STATE_PROVINCE as the name for the level attribute, select VARCHAR2 from the data type drop down list box and type 25 for length. Click Add.

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image


4 .

in the New Dimension Wizard: Level Attributes page, select COUNTRY from the level drop-down.

You see the pre-defined attribute ID.

Move your mouse over this icon to see the image

You have to update the ID attribute from number datatype to char datatype. To update the ID attribute. Select ID from the list box on the right hand-side. Change the datataype to CHAR and type 2 for length. Click Update.

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image

Add a new attribute NAME. Type NAME as the name for the level attribute, select VARCHAR2 from the data type drop down list box and type 40 for length. Click Add.

Move your mouse over this icon to see the image

Click Next to move to the next step of creating a hierarchy of levels using the New Dimension Wizard: Hierarchy page.


Defining a Hierarchy of Levels

Back to SubTopic List

In this topic you will learn how the New Dimensions Wizard: Hierarchies page enables you to define one or more hierarchies. Then, define how the levels in each hierarchy relate to each other in a parent-child type relationship. You have to explicitly determine a dimension's hierarchy, Warehouse Builder does not have the artificial intelligence to determine a dimension's hierarchy.

1.

In the New Dimension Wizard: Hierarchy page type WAREHOUSES as the hierarchy name, WRE as the prefix. Click Add.

Move your mouse over this icon to see the image

Click Next.

Move your mouse over this icon to see the image

 

2.

The New Dimension Wizard: Level Relationships page appears. In the hierarchy drop-down list box select WAREHOUSES.

Select and move all the levels (COUNTRY, LOCATION, WAREHOUSE) to the Selected Levels list using the >> (double arrow). In the Selected Levels list box the levels should appear in the order as COUNTRY should appear above LOCATION. WAREHOUSE should appear below LOCATION.

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image

On this page you define how the levels in each hierarchy relate to each other. You can use the up and down arrows to arrange the selected levels into the appropriate hierarchical level relationship, making sure to place the lowest level of the hierarchy at the bottom of the list.

 

3 .

Click Next. The New Dimension Wizard: Finish page appears. Click Finish to create the WAREHOUSE dimension.

Move your mouse over this icon to see the image

 


Generating the Dimension and Examining the Code

Back to SubTopic List

Warehouse Builder generates the code to implement the objects. For a dimension in a relational implementation, Warehouse Builder will generate the relational table definition, the constraint definition as well as the dimension object definition for the Oracle database.

1.

To see the code Warehouse Builder generates, In the OWB10g_DEMO project, expand the Databases node, expand the Oracle node, and expand the WH target module. Expand the DIMENSIONS node and right click the WAREHOUSE dimension. Select Generate.

Move your mouse over this icon to see the image


2.

In the Generation Results window, select the WAREHOUSE dimensions. Select the Script tab in the bottom half of the screen, and select the WAREHOUSE_DIM.ddl DIMENSION script. Click View Code at the bottom.

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image


3 .

You view the create dimension definition in the script window. Close the script window and click OK to close the Generation Results window.

Move your mouse over this icon to see the image


 

Examining the Sales Cube

Back to Topic List

Cubes are the numerical measures of the business. The cube table is the largest table in the star schema. Using the cube editor you will view the SALES cube definition.

1.

In the OWB10g_DEMO project, expand Databases, expand the Oracle node and expand the WH target module. Expand the Cubes node. Right click the SALES cube and select Editor.

Move your mouse over this icon to see the image

 

 

2.

The SALES cube has one measure REVENUE and six dimensions CHANNEL, PRODUCT, SALES_REP, CUSTOMER, PROMOTION, T_TIME. Close the cube editor. In the next topic you will learn how to create a cube.

Move your mouse over this icon to see the image

 

 

Creating the INVENTORIES Cube

Back to Topic List

In this topic you will learn how to create a cube INVENTORIES which holds inventory information for the data warehouse.

1.

To create a cube, right click the Cubes node, select Create Cube, and click Next in the New Cube Wizard: Welcome page

Move your mouse over this icon to see the image

 

 

2.

In the New Cube Wizard: Name page, type INVENTORIES as the name of the cube. Click Next.

Move your mouse over this icon to see the image

 

3.

The New Cube Wizard: Define Foreign Keys page appears. The cube will have three dimensions: PRODUCT, T_TIME and WAREHOUSE. For each of these dimensions, you have to select the lowest level in the dimension, the corresponding unique or primary key, and add the foreign key.

Select dimension PRODUCT from the dimension drop-down box.

Move your mouse over this icon to see the image

Select level PRODUCT from the level drop-down box.

Move your mouse over this icon to see the image

Click Add.

Move your mouse over this icon to see the image

Clicking Add moves the choices you have made to the List of Foreign Keys field.

Move your mouse over this icon to see the image

 

4.

In the New Cube Wizard: Define Foreign Keys page,

Select dimension T_TIME from the dimension drop-down box.

Move your mouse over this icon to see the image

Select level L_MONTH from the level drop-down box.

Move your mouse over this icon to see the image

Click Add.

Move your mouse over this icon to see the image

Clicking Add moves the choices you have made to the List of Foreign Keys field.

Move your mouse over this icon to see the image

 

5.

In the New Cube Wizard: Define Foreign Keys page,

Select dimension WAREHOUSE, level WAREHOUSE and click Add.

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image

 


6.

In the New Cube Wizard: Define Foreign Keys page, select the checkbox Create a segmented unique key from foreign keys.Click Next.

Move your mouse over this icon to see the image

Create a segmented unique key from foreign keys will ensure the combination of product, month, and warehouse in the INVENTORIES cube be unique. Warehouse Builder automatically creates the unique key definition for you.


7.

The New Cube Wizard: Define Measures page appears. Click Add, add a measure, AMOUNT, data type NUMBER. Click Next.

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image

On this page you define the numeric or quantitative columns for the cube.


8.

The New Cube Wizard: Finish page appears. Click Finish to complete the object definition creation.

Move your mouse over this icon to see the image

 


9.

The INVENTORIES cube as it appears in the cube editor.

Move your mouse over this icon to see the image

 

Summary

Back to Topic List

Dimensional structures are extremely important in a business intelligence environment. You are now able to appreciate how Oracle Warehouse Builder enables dimensional design, which allows you to create structures that business users understand. Even relational structures in the Oracle database benefit from the dimensional design by the Dimensional object code generation.

In this module you should have learned how to:

Define a dimension by using the New Dimension Wizard
Define the cube table by using the New Cube Wizard

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy