1 data warehouses c hapter 2. 2 chapter 2 outline chapter 2 outline – introduction –data...

32
1 Data Warehouses Data Warehouses C C hapter 2 hapter 2

Upload: jean-patterson

Post on 23-Dec-2015

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

1

Data WarehousesData Warehouses

CChapter 2hapter 2

Page 2: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

2

Chapter 2 OutlineChapter 2 Outline– IntroductionIntroduction– Data WarehousesData Warehouses– Data Warehouse in OrganisationData Warehouse in Organisation– OLTP vs. OLAPOLTP vs. OLAP– Why Separate Data Warehouse?Why Separate Data Warehouse?– A multi-dimensional data modelA multi-dimensional data model

Page 3: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

3

Merger of Malaysian BanksMerger of Malaysian Banks

Page 4: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

4

Jobstreet.com.myJobstreet.com.my

Page 5: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

5

Page 6: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

6

Data WarehousesData Warehouses

According to the original definition of Bill According to the original definition of Bill Inmon (1996), the father of data Inmon (1996), the father of data warehouses, a data warehouse is warehouses, a data warehouse is a a subject-orientedsubject-oriented, , integratedintegrated, , time-time-variantvariant, , non-volatilenon-volatile collection of data in collection of data in support of management’s decision-support of management’s decision-making processmaking process. .

Page 7: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

7

Data Warehouse—Subject-Data Warehouse—Subject-OrientedOriented

Organized around major subjects, such as Organized around major subjects, such as customer, customer,

product, salesproduct, sales..

Focusing on the modeling and analysis of data for Focusing on the modeling and analysis of data for

decision makers, not on daily operations or decision makers, not on daily operations or

transaction processing.transaction processing.

Provide Provide a simple and concisea simple and concise view around particular view around particular

subject issues by subject issues by excluding data that are not useful in excluding data that are not useful in

the decision support processthe decision support process..

Page 8: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

8

Data Warehouse—IntegratedData Warehouse—Integrated

Constructed by integrating multiple, Constructed by integrating multiple, heterogeneous data sourcesheterogeneous data sources– relational databases, flat files, on-line transaction relational databases, flat files, on-line transaction

recordsrecords Data cleaning and data integration Data cleaning and data integration

techniques are applied.techniques are applied.– Ensure consistency in naming conventions, Ensure consistency in naming conventions,

encoding structures, attribute measures, etc. encoding structures, attribute measures, etc. among different data sourcesamong different data sources

» E.g., Hotel price: currency, tax, breakfast covered, etc.E.g., Hotel price: currency, tax, breakfast covered, etc.– When data is moved to the warehouse, it is When data is moved to the warehouse, it is

converted. converted.

Page 9: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

9

Data Warehouse—Time VariantData Warehouse—Time Variant

The time horizon for the data warehouse is The time horizon for the data warehouse is

significantly longer than that of operational systems.significantly longer than that of operational systems.– Operational database: current value data.Operational database: current value data.

– Data warehouse data: provide information from a historical Data warehouse data: provide information from a historical

perspective (e.g., past 5-10 years)perspective (e.g., past 5-10 years)

Every key structure in the data warehouseEvery key structure in the data warehouse– Contains an element of time, explicitly or implicitlyContains an element of time, explicitly or implicitly

– But the key of operational data may or may not contain “time But the key of operational data may or may not contain “time

element”.element”.

Page 10: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

10

Data Warehouse—Non-VolatileData Warehouse—Non-Volatile

A A physically separate storephysically separate store of data transformed from of data transformed from

the operational environment.the operational environment.

Operational Operational update of data does not occurupdate of data does not occur in the data in the data

warehouse environment.warehouse environment.

– Does not require transaction processing, recovery, and Does not require transaction processing, recovery, and

concurrency control mechanismsconcurrency control mechanisms

– Requires only two operations in data accessing: Requires only two operations in data accessing:

» initial loading of datainitial loading of data and and access of dataaccess of data..

Page 11: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

11

data warehousesdata warehouses

are the foundation of the business IT are the foundation of the business IT infrastructures that collect data from infrastructures that collect data from several dispersed information sources several dispersed information sources and are designed to allow decision and are designed to allow decision makers have prompt access to makers have prompt access to information for purpose of reporting information for purpose of reporting

Page 12: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

Data Warehouse in Data Warehouse in OrganisationOrganisation

Aetna Life uses IBM’s data warehouse and data Aetna Life uses IBM’s data warehouse and data mining tools to have a better understanding for mining tools to have a better understanding for meeting the specific needs of its customers meeting the specific needs of its customers

– to estimate the performance of to estimate the performance of new products and new products and

services. services. Guinness Limited is a British company that has Guinness Limited is a British company that has

achieved its ability to be a major global force achieved its ability to be a major global force

- while serving the local market needs to overcome - while serving the local market needs to overcome the difficulties of extracting data from transaction the difficulties of extracting data from transaction processing systems for populating a processing systems for populating a data warehouse data warehouse with with valuable business information valuable business information

12

Page 13: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

Data Warehouse in Data Warehouse in OrganisationOrganisation

Parkson Corporation Sdn Bhd is a Parkson Corporation Sdn Bhd is a Malaysian company that has increased Malaysian company that has increased marketing program efficiency and marketing program efficiency and market share through implementation of market share through implementation of data warehouse and data mining to data warehouse and data mining to work for its work for its 2929 stores in Malaysia stores in Malaysia

13

Page 14: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

Data Warehouse in Data Warehouse in OrganisationOrganisation

According to SAS Asia Pacific Risk Management According to SAS Asia Pacific Risk Management Practice head, John Foulley said many banks in Practice head, John Foulley said many banks in Malaysia had the problem of integrating their data Malaysia had the problem of integrating their data efficiently and this had led to efficiently and this had led to misplacement of misplacement of information and poor quality data information and poor quality data .  .  

According to this statement, most of Malaysian banks According to this statement, most of Malaysian banks do not have implementation of data warehouse yetdo not have implementation of data warehouse yet. The . The local banks have to implement Basel II framework was local banks have to implement Basel II framework was instructed by Bank Negara for it is either 2008 or 2010. instructed by Bank Negara for it is either 2008 or 2010.

The framework addresses on The framework addresses on credit and operational credit and operational

risks which requires the ready of data warehouse.risks which requires the ready of data warehouse.   

14

Page 15: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

Data Warehouse in Data Warehouse in OrganisationOrganisation

Alliance Banking Group allocated 36 Alliance Banking Group allocated 36 million to build data warehouse. million to build data warehouse.

Insurance Services Malaysia handles Insurance Services Malaysia handles more than 50 insurance companies in more than 50 insurance companies in Malaysia. They require insurance Malaysia. They require insurance companies to deliver clean, structured companies to deliver clean, structured data to them to build the data data to them to build the data warehouse.warehouse.

15

Page 16: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

Data Warehouse in Data Warehouse in OrganisationOrganisation

According to Malaysia's EON Bank, they According to Malaysia's EON Bank, they have problem to access the complete view have problem to access the complete view of the customer due to loan information of the customer due to loan information sitting in one transactional system and sitting in one transactional system and credit details in another system.credit details in another system.

the AmBank Group has invested over the AmBank Group has invested over RM10 million involving the implementation RM10 million involving the implementation of data integration and management of data integration and management solution. solution.

16

Page 17: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

17

OLTP vs. OLAPOLTP vs. OLAP OLTP OLAP

users clerk, IT professional knowledge worker

function day to day operations decision support

DB design application-oriented subject-oriented

data current, up-to-date detailed, flat relational isolated

historical, summarized, multidimensional integrated, consolidated

usage repetitive ad-hoc

access read/write index/hash on prim. key

lots of scans

unit of work short, simple transaction complex query

# records accessed tens millions

#users thousands hundreds

DB size 100MB-GB 100GB-TB

metric transaction throughput query throughput, response

Page 18: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

18

Page 19: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

19

Why Separate Data Warehouse?Why Separate Data Warehouse?

High performance for both systemsHigh performance for both systems– DBMS— tuned for OLTP: access methods, indexing, DBMS— tuned for OLTP: access methods, indexing,

concurrency control, recoveryconcurrency control, recovery– Warehouse—tuned for OLAP: complex OLAP queries, Warehouse—tuned for OLAP: complex OLAP queries,

multidimensional view, consolidation.multidimensional view, consolidation. Different functions and different data:Different functions and different data:

– missing datamissing data: Decision support requires historical data which : Decision support requires historical data which operational DBs do not typically maintainoperational DBs do not typically maintain

– data consolidationdata consolidation: DS requires consolidation (aggregation, : DS requires consolidation (aggregation, summarization) of data from heterogeneous sourcessummarization) of data from heterogeneous sources

– data qualitydata quality: different sources typically use inconsistent data : different sources typically use inconsistent data representations, codes and formats which have to be representations, codes and formats which have to be reconciledreconciled

Page 20: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

20

Relational View of Data/ Relational View of Data/ SpreadsheetSpreadsheet

ProdID LocID Date Quantity UnitPrice 123 Dallas 022900 5 25 123 Houston 020100 10 20 150 Dallas 031500 1 100 150 Dallas 031500 5 95 150 Fort

Worth 021000 5 80

150 Chicago 012000 20 75 200 Seattle 030100 5 50 300 Rochester 021500 200 5 500 Bradenton 022000 15 20 500 Chicago 012000 10 25 1

Page 21: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

21

From Tables/ Relations and From Tables/ Relations and Spreadsheets to Data CubesSpreadsheets to Data Cubes

A data warehouse is based on a A data warehouse is based on a multidimensional multidimensional

data modeldata model which views data in the form of a data which views data in the form of a data

cubecube

A data cube, such as A data cube, such as salessales, allows data to be , allows data to be

modeled and viewed in multiple dimensionsmodeled and viewed in multiple dimensions– Dimension tables, such as Dimension tables, such as item (item_name, brand, type), item (item_name, brand, type), oror

time(day, week, month, quarter, year) time(day, week, month, quarter, year)

– Fact table contains measures (such as Fact table contains measures (such as dollars_solddollars_sold) and ) and

keys to each of the related dimension tableskeys to each of the related dimension tables

Page 22: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

22

Conceptual Modeling of Data Conceptual Modeling of Data WarehousesWarehouses

Modeling data warehouses: dimensions & Modeling data warehouses: dimensions &

measuresmeasures

– Star schemaStar schema: : A fact table in the middle connected A fact table in the middle connected

to a set of dimension tables to a set of dimension tables

– Snowflake schemaSnowflake schema: : A refinement of star schema A refinement of star schema

where some dimensional hierarchy is where some dimensional hierarchy is normalizednormalized

into a set of smaller dimension tablesinto a set of smaller dimension tables, forming a , forming a

shape similar to snowflakeshape similar to snowflake

Page 23: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

23

Star SchemaStar Schema

Page 24: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

24

Another Example of Star Another Example of Star SchemaSchema

time_keydayday_of_the_weekmonthquarteryear

time

location_keystreetcityprovince_or_streetcountry

location

Sales Fact Table

time_key

item_key

branch_key

location_key

units_sold

dollars_sold

avg_sales

Measures

item_keyitem_namebrandtypesupplier_type

item

branch_keybranch_namebranch_type

branch

Page 25: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

25

Example of Snowflake Example of Snowflake SchemaSchema

time_keydayday_of_the_weekmonthquarteryear

time

location_keystreetcity_key

location

Sales Fact Table

time_key

item_key

branch_key

location_key

units_sold

dollars_sold

avg_sales

Measures

item_keyitem_namebrandtypesupplier_key

item

branch_keybranch_namebranch_type

branch

supplier_keysupplier_type

supplier

city_keycityprovince_or_streetcountry

city

Page 26: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

26

Multidimensional DataMultidimensional Data Sales volume as a function of product, Sales volume as a function of product,

month, and regionmonth, and region

Pro

duct

Regio

n

Month

Dimensions: Product, Location, TimeHierarchical summarization paths

Industry Region Year

Category Country Quarter

Product City Month Week

Office Day

Page 27: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

27

A Sample Data CubeA Sample Data CubeTotal annual salesof TV in U.S.A.Date

Produ

ct

Cou

ntr

ysum

sum TV

VCRPC

1Qtr 2Qtr 3Qtr 4Qtr

U.S.A

Canada

Mexico

sum

Page 28: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

28

Browsing a Data CubeBrowsing a Data Cube

VisualizationVisualization OLAP capabilitiesOLAP capabilities Interactive manipulationInteractive manipulation

Page 29: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

29

Typical OLAP OperationsTypical OLAP Operations

Roll up (drill-up):Roll up (drill-up): summarize data summarize data

– by climbing up hierarchy or by dimension by climbing up hierarchy or by dimension reductionreduction

Drill down (roll down):Drill down (roll down): reverse of roll-up reverse of roll-up

– from higher level summary to lower level summary from higher level summary to lower level summary or detailed data, or introducing new dimensionsor detailed data, or introducing new dimensions

Slice and dice:Slice and dice:

– project and selectproject and select

Page 30: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

30

OLAP OperationsOLAP Operations

Single Cell Multiple Cells Slice Dice

Roll Up

Drill Down

Page 31: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

31

Design of a Data Warehouse: A Design of a Data Warehouse: A Business Analysis FrameworkBusiness Analysis Framework

Four views regarding the design of a data warehouse Four views regarding the design of a data warehouse

– Top-down viewTop-down view

» allows selection of the relevant information necessary for the allows selection of the relevant information necessary for the data warehousedata warehouse

– Data source viewData source view

» exposes the information being captured, stored, and exposes the information being captured, stored, and managed by operational systemsmanaged by operational systems

– Data warehouse viewData warehouse view

» consists of fact tables and dimension tablesconsists of fact tables and dimension tables

– Business query viewBusiness query view

» sees the perspectives of data in the warehouse from the view sees the perspectives of data in the warehouse from the view of end-userof end-user

Page 32: 1 Data Warehouses C hapter 2. 2 Chapter 2 Outline Chapter 2 Outline – Introduction –Data Warehouses –Data Warehouse in Organisation – OLTP vs. OLAP –Why

32

Data Warehouse Back-End Tools Data Warehouse Back-End Tools and Utilitiesand Utilities

Data extraction:Data extraction:– get data from multiple, heterogeneous, and external get data from multiple, heterogeneous, and external

sourcessources Data cleaning:Data cleaning:

– detect errors in the data and rectify them when possibledetect errors in the data and rectify them when possible Data transformation:Data transformation:

– convert data from legacy or host format to warehouse convert data from legacy or host format to warehouse formatformat

Load:Load:– sort, summarize, consolidate, compute views, check sort, summarize, consolidate, compute views, check

integrity, and build indicies and partitionsintegrity, and build indicies and partitions RefreshRefresh

– propagate the updates from the data sources to the propagate the updates from the data sources to the warehousewarehouse