Presentation is loading. Please wait.

Presentation is loading. Please wait.

3 Copyright © 2006, Oracle. All rights reserved. Business, Logical, and Dimensional Modeling.

Similar presentations


Presentation on theme: "3 Copyright © 2006, Oracle. All rights reserved. Business, Logical, and Dimensional Modeling."— Presentation transcript:

1 3 Copyright © 2006, Oracle. All rights reserved. Business, Logical, and Dimensional Modeling

2 Copyright © 2006, Oracle. All rights reserved. 3 - 2 Objectives After completing this lesson, you should be able to do the following: Discuss data warehouse environment data structures Discuss data warehouse database design phases: –Defining the business model –Defining the logical model –Defining the dimensional model

3 Copyright © 2006, Oracle. All rights reserved. 3 - 3 Data Warehouse Modeling Issues Among the main issues that data warehouse data modelers face are: Different data types Many ways to use warehouse data Many ways to structure the data Multiple modeling techniques Planned replication Large volumes of data

4 Copyright © 2006, Oracle. All rights reserved. 3 - 4

5 Copyright © 2006, Oracle. All rights reserved. 3 - 5 Data Warehouse Environment Data Structures The data modeling structures that are commonly found in a data warehouse environment are: Third normal form (3NF) Star schema Snowflake schema

6 Copyright © 2006, Oracle. All rights reserved. 3 - 6 Star Schema Model Product Table Product_id Product_disc,... Time Table Day_id Month_id Year_id,... Sales Fact Table Product_id Store_id Item_id Day_id Sales_amount Sales_units,... Item Table Item_id Item_desc,... Store Table Store_id District_id,... Central fact table Denormalized dimensions

7 Copyright © 2006, Oracle. All rights reserved. 3 - 7 Snowflake Schema Model Time Table Week_id Period_id Year_id Dept Table Dept_id Dept_desc Mgr_id Mgr Table Dept_id Mgr_id Mgr_name Product Table Product_id Product_desc Item Table Item_id Item_desc Dept_id Sales Fact Table Item_id Store_id Product_id Week_id Sales_amount Sales_units Store Table Store_id Store_desc District_id District Table District_id District_desc

8 Copyright © 2006, Oracle. All rights reserved. 3 - 8 Snowflake Schema Model Can be used directly by some tools Is more flexible to change Provides for speedier data loading Can become large and unmanageable Degrades query performance Has more complex metadata CountryStateCountyCity

9 Copyright © 2006, Oracle. All rights reserved. 3 - 9 Data Warehouse Design Phases Phase 1: –Defining the business models Phase 2: –Defining the logical model Phase 3: –Defining the dimensional model Phase 4: –Defining the physical model

10 Copyright © 2006, Oracle. All rights reserved. 3 - 10

11 Copyright © 2006, Oracle. All rights reserved. 3 - 11 Phase 1: Defining the Business Model Performing strategic analysis Creating the business model Documenting metadata

12 Copyright © 2006, Oracle. All rights reserved. 3 - 12 Performing Strategic Analysis Identify crucial business processes. Understand business processes. Prioritize and select the business processes to implement. Business benefit LowHigh Low High Feasibility

13 Copyright © 2006, Oracle. All rights reserved. 3 - 13 Creating the Business Model Defining business requirements Determining granularity Documenting metadata

14 Copyright © 2006, Oracle. All rights reserved. 3 - 14 Existing metadataProduction ERD model Interviews to collect business requirements Research Business Requirements Drive the Design Process Primary input Secondary input

15 Copyright © 2006, Oracle. All rights reserved. 3 - 15

16 Copyright © 2006, Oracle. All rights reserved. 3 - 16 Using a Business Process Matrix Sample of business process matrix Promotions Channels Products Times (Date) Inventory Customers ReturnsSales Business Processes Business Dimensions

17 Copyright © 2006, Oracle. All rights reserved. 3 - 17 Identifying Business Measures and Dimensions The attribute is perceived as constant or discrete: Products Promotions Customers Countries Channels Times The attribute varies continuously: Sales Quantity sold Units sold Cost Measures Dimensions

18 Copyright © 2006, Oracle. All rights reserved. 3 - 18

19 Copyright © 2006, Oracle. All rights reserved. 3 - 19 Determining Granularity YEAR? QUARTER? MONTH? WEEK? DAY? TIMES Product category? Product subcategory? Product name? Product desc? Product item? PRODUCTS

20 Copyright © 2006, Oracle. All rights reserved. 3 - 20 Identifying Business Definitions and Rules Credit Rating Meaning A+ 0 bad checks or bank credit failures A 1 bad check or bank credit failures B 2 bad checks or bank credit failures C3 or more bad checks or bank credit failures Customer Rule 1 A customer with a credit rating of A or above will receive a 10% discount on any order totaling $500 (U.S.) or more. Rule 2 A customer with a credit rating of A or above will receive a 5% discount on any order totaling $250 (U.S.) but less than $500. … Rule 5 A customer with a credit rating of C will not receive any discounts on purchases. Order …

21 Copyright © 2006, Oracle. All rights reserved. 3 - 21 Documenting Metadata Documenting metadata should include: Documenting the design process Documenting the development process Providing a record of changes Recording enhancements over time

22 Copyright © 2006, Oracle. All rights reserved. 3 - 22 Business Metadata Elements Name of the measure Business dimensions –Dimension attributes Sample data Business definition and rules

23 Copyright © 2006, Oracle. All rights reserved. 3 - 23 Metadata Documentation Approaches Automated –Data modeling tools –ETL tools –End-user tools Manual

24 Copyright © 2006, Oracle. All rights reserved. 3 - 24 Phase 2: Designing the Logical Model Entity Relationship Modeling (ERM) uses entity relationship diagram (ERD): Each CUSTOMER belongs to one COUNTRY. Each COUNTRY can have many CUSTOMERS. Customers Cust_name Country_Id Cust_Addr … Countries Country_id Name Region ISO_Code … Belongs to have Entity Attributes Relationship

25 Copyright © 2006, Oracle. All rights reserved. 3 - 25

26 Copyright © 2006, Oracle. All rights reserved. 3 - 26 Phase 3: Defining the Dimensional Model Identify fact tables: –Translate business measures into fact tables. –Analyze source system information for additional measures. Identify dimension tables. Link fact tables to the dimension tables. Model the time dimension.

27 Copyright © 2006, Oracle. All rights reserved. 3 - 27 Star Dimensional Modeling

28 Copyright © 2006, Oracle. All rights reserved. 3 - 28 Advantages of Using a Star Dimensional Model Supports multidimensional analysis Creates a design that improves performance Enables optimizers to yield better execution plans Parallels end-user perceptions Provides an extensible design Broadens the choices for data access tools

29 Copyright © 2006, Oracle. All rights reserved. 3 - 29 Fact Table Characteristics Fact tables: Contain numerical metrics of the business Hold large volumes of data Grow quickly Can contain base, derived, and summarized data Are typically additive Are joined to dimension tables through foreign keys that reference primary keys in the dimension tables What are factless fact tables? Sales (Fact Table) PROD_ID CUST_ID TIME_ID CHANNEL_ID PROMO_ID QUANTITY_SOLD AMOUNT_SOLD...

30 Copyright © 2006, Oracle. All rights reserved. 3 - 30

31 Copyright © 2006, Oracle. All rights reserved. 3 - 31 More on Factless Fact Tables Emp_FK Sal_FK Age_FK Ed_FK Grade_FK Grade dimension Grade_PK Education dimension Ed_PK Employee dimension Emp_PK Salary dimension Sal_PK Age dimension Age_PK

32 Copyright © 2006, Oracle. All rights reserved. 3 - 32 Identifying Base and Derived Measures Business Measures Quantity sold Amount sold Profit Sales Fact Table Base Derived Business measures Facts (Base, Derived) Quantity sold Amount sold Profit

33 Copyright © 2006, Oracle. All rights reserved. 3 - 33

34 Copyright © 2006, Oracle. All rights reserved. 3 - 34 Fact Table Measures Fact table measures can be: Nonadditive: Cannot be added along any dimension Semiadditive: Added along some dimensions Additive: Added across all dimensions

35 Copyright © 2006, Oracle. All rights reserved. 3 - 35 Dimension Table Characteristics Dimension tables: Contain textual information that represents the attributes of the business Contain relatively static data Are joined to a fact table through a foreign key reference

36 Copyright © 2006, Oracle. All rights reserved. 3 - 36 Translating Business Dimensions into Dimension Tables Business dimensions Dimension tables Customers Products Channels Countries Promotions Product_status Prod_List_price Products Dimension Table Prod_Id Prod_desc Prod_Subcategory Prod_name Prod_Category Prod_category_id Prod_Pack_Size … Prod_Status Prod_Weight _class Prod_Category_Desc

37 Copyright © 2006, Oracle. All rights reserved. 3 - 37 Slowly Changing Dimensions

38 Copyright © 2006, Oracle. All rights reserved. 3 - 38 Slowly Changing Dimension (SCD): An Example Where Product_key is a calculated number stored within the database Business Dimension Product Products: SCD Product weight, Product package size varying over time Product_status Prod_List_price Products Dimension Table Prod_Id (Natural) Prod_desc Prod_Subcategory Prod_name Prod_Category Prod_category_id Prod_Pack_Size … Prod_Status Prod_Weight_class Prod_Category_Desc Id (Surrogate) Prod_Eff_From Prod_Eff_To

39 Copyright © 2006, Oracle. All rights reserved. 3 - 39 Types of Database Keys Primary keys (PKs) Foreign keys (FKs) Composite keys Surrogate keys

40 Copyright © 2006, Oracle. All rights reserved. 3 - 40

41 Copyright © 2006, Oracle. All rights reserved. 3 - 41 Using Time in the Data Warehouse Defining standards for time is critical. Aggregation based on time is complex.

42 Copyright © 2006, Oracle. All rights reserved. 3 - 42 Time Dimension Time dimension is critical to the data warehouse. Choose the right granularity for the Time dimension. Where should the element of time be stored? Time dimension Sales fact Current dimension grain Future dimension grain Fiscal month Fiscal year Fiscal quarter Fiscal week Day

43 Copyright © 2006, Oracle. All rights reserved. 3 - 43

44 Copyright © 2006, Oracle. All rights reserved. 3 - 44 Identify Hierarchies for Dimensions State/Province Region Country City Geography hierarchy Fiscal year Fiscal quarter Fiscal month Fiscal time Fiscal date Calendar year Calendar quarter Calendar month Calendar time Calendar date Multiple time hierarchies

45 Copyright © 2006, Oracle. All rights reserved. 3 - 45 State 5State1State 2 Region 2 Country2Country 4 Data Drilling State 4 Group Market Hierarchy Region 1 Country1 State 6State 3 Country3 City1City2

46 Copyright © 2006, Oracle. All rights reserved. 3 - 46 Using Data Modeling Tools Tools with a GUI enable definition, modeling, and reporting. Avoid a mix of modeling techniques caused by the following: –Development pressures –Developers with lack of knowledge –No strategy Determine a strategy for data modeling. Write and publish data models formally. Make the data models available electronically.

47 Copyright © 2006, Oracle. All rights reserved. 3 - 47

48 Copyright © 2006, Oracle. All rights reserved. 3 - 48 Summary In this lesson, you should have learned about: Data warehouse environment data structures Data warehouse database design phases: –Defining the business model –Defining the logical model –Defining the dimensional model

49 Copyright © 2006, Oracle. All rights reserved. 3 - 49 Practice 3-1: Overview This practice covers the following topics: Identifying the facts, measures, hierarchies, and slowly changing dimensions based on the RISD scenario given Exploring viewlet-based demonstrations provided for modeling concepts, and answering the questions in these interactive viewlets

50 Copyright © 2006, Oracle. All rights reserved. 3 - 50

51 Copyright © 2006, Oracle. All rights reserved. 3 - 51

52 Copyright © 2006, Oracle. All rights reserved. 3 - 52


Download ppt "3 Copyright © 2006, Oracle. All rights reserved. Business, Logical, and Dimensional Modeling."

Similar presentations


Ads by Google