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.
This lesson will take approximately 45 minutes to complete.
Viewing Screenshots
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.
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.
2.
Select the T_TIME dimension
definition. Right click on T_TIME dimension and select
Editor.
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).
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.
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.
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.
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.
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.
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.
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.
On clicking Add the level COUNTRY appears on the right-hand side.
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.
On clicking Add the level LOCATIONS appears on the right-hand side below
COUNTRY.
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.
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.
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.
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.
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.
3 .
In the New Dimension Wizard: Level Attributes
page, select LOCATION from the level drop-down.
You see the pre-defined attribute ID. Make no change to it.
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.
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.
4 .
in the New Dimension Wizard: Level Attributes
page, select COUNTRY from the level drop-down.
You see the pre-defined attribute ID.
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.
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.
Click Next to move to the next step of creating a hierarchy
of levels using the New Dimension Wizard: Hierarchy page.
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.
Click Next.
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.
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.
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.
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.
3 .
You view the create dimension definition in
the script window. Close the script window and click OK
to close the Generation Results window.
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.
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.
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
2.
In the New Cube Wizard:
Name page, type INVENTORIES as
the name of the cube. Click Next.
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.
Select level PRODUCT from the level drop-down box.
Click Add.
Clicking Add moves the choices you have made to the List of Foreign Keys
field.
4.
In theNew
Cube Wizard: Define Foreign Keys page,
Select dimension T_TIME from the dimension drop-down
box.
Select level L_MONTH from the level drop-down box.
Click Add.
Clicking Add moves the choices you have made to the List of Foreign Keys
field.
5.
In the New Cube Wizard:
Define Foreign Keys page,
Select dimension WAREHOUSE, level WAREHOUSE
and click Add.
6.
In the New Cube Wizard:
Define Foreign Keys page, select the checkbox
Create a segmented unique key from foreign keys.Click
Next.
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.
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.
9.
The INVENTORIES cube as it appears in the
cube editor.
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
Move your mouse over this icon to hide all screenshots