30
Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data Warehouse Ronald Ortner and David Pietzka 11. V. 2012 Ronald Ortner and David Pietzka

Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

  • Upload
    others

  • View
    15

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

InformationslogistikUnit 8: OLTP, OLAP, SAP, and Data Warehouse

Ronald Ortner and David Pietzka

11. V. 2012

Ronald Ortner and David Pietzka

Page 2: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Outline

1 Reminder: NormalizationAnother Example for Normalization

2 Transactions, OLTP, OLAP, SAP, and Data WarehouseTransactionsOLTP and OLAPSAPData Warehouse & OLAP

Ronald Ortner and David Pietzka

Page 3: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Another Example for Normalization

Outline

1 Reminder: NormalizationAnother Example for Normalization

2 Transactions, OLTP, OLAP, SAP, and Data WarehouseTransactionsOLTP and OLAPSAPData Warehouse & OLAP

Ronald Ortner and David Pietzka

Page 4: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Another Example for Normalization

Another Example for Normalization

Link:http://wikis.gm.fh-koeln.de/wiki_db/Category/Normalformen

Human resources database:

pers_no name salary dept boss project course

FDs:{pers_no} → {name, salary, dept, boss}

{dept} → {boss}

{boss} → {dept}

MVDs:{pers_no} →→ {project}

{pers_no} →→ {course}

Ronald Ortner and David Pietzka

Page 5: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Another Example for Normalization

Another Example

Apply decomposition algorithm:

FD {pers_no} → {name, salary, dept, boss} givesdecomposition

pers_no name salary dept boss

pers_no project course

Ronald Ortner and David Pietzka

Page 6: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Another Example for Normalization

Another Example

Apply decomposition algorithm:

FD {dept} → {boss} gives decomposition

pers_no name salary dept dept boss

pers_no project course

Ronald Ortner and David Pietzka

Page 7: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Another Example for Normalization

Another Example

Apply decomposition algorithm:

MVDs {pers_no} →→ {project} and {pers_no} →→ {course}give decomposition

pers_no name salary dept dept boss

pers_no project pers_no course

Ronald Ortner and David Pietzka

Page 8: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Another Example for Normalization

Another Example

Apply decomposition algorithm:

MVDs {pers_no} →→ {project} and {pers_no} →→ {course}give decomposition

pers_no name salary dept dept boss

pers_no project pers_no course

is in 4NF

Ronald Ortner and David Pietzka

Page 9: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Another Example for Normalization

Another Example

When there is more information about projects and courses to store:

pers_no name salary dept dept boss

pers_no project_no pers_no course_no

project_no name ... course_no name ...

Ronald Ortner and David Pietzka

Page 10: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Transactions

Outline

1 Reminder: NormalizationAnother Example for Normalization

2 Transactions, OLTP, OLAP, SAP, and Data WarehouseTransactionsOLTP and OLAPSAPData Warehouse & OLAP

Ronald Ortner and David Pietzka

Page 11: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Transactions

Transactions

ACID: atomic, consistent, isolated and durableBegin transactionExecute manipulations (Updates, Inserts, Delets, ...)Commit or Rollback

Ronald Ortner and David Pietzka

Page 12: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

OLTP and OLAP

Outline

1 Reminder: NormalizationAnother Example for Normalization

2 Transactions, OLTP, OLAP, SAP, and Data WarehouseTransactionsOLTP and OLAPSAPData Warehouse & OLAP

Ronald Ortner and David Pietzka

Page 13: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

OLTP and OLAP

OLTP vs. OLAP

OLTP: online transaction processingDatabase applications for ongoing workExamples: orders, bookings, etc.current data is important→ many updates and changes in database

OLAP: online analytical processingDatabase applications for analysis and decision supportExample: analysis of trendshistorical data is important→ lots of data, need information in aggregated form

Ronald Ortner and David Pietzka

Page 14: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

OLTP and OLAP

OLTP vs. OLAP

OLTP: online transaction processingDatabase applications for ongoing workExamples: orders, bookings, etc.current data is important→ many updates and changes in database

OLAP: online analytical processingDatabase applications for analysis and decision supportExample: analysis of trendshistorical data is important→ lots of data, need information in aggregated form

Ronald Ortner and David Pietzka

Page 15: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

SAP

Outline

1 Reminder: NormalizationAnother Example for Normalization

2 Transactions, OLTP, OLAP, SAP, and Data WarehouseTransactionsOLTP and OLAPSAPData Warehouse & OLAP

Ronald Ortner and David Pietzka

Page 16: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

SAP

SAP

SAP: software system, mainly for OLTP

SAP has three levels:big relational database system in the backgroundapplications that work on the database systemgraphical user interface

Access to underlying database system:Some tables can be accessed also outside SAP (using SQL).Usually only read access is sensible.Some other tables can be accessed only via SAP.

Ronald Ortner and David Pietzka

Page 17: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

SAP

SAP

SAP: software system, mainly for OLTP

SAP has three levels:big relational database system in the backgroundapplications that work on the database systemgraphical user interface

Access to underlying database system:Some tables can be accessed also outside SAP (using SQL).Usually only read access is sensible.Some other tables can be accessed only via SAP.

Ronald Ortner and David Pietzka

Page 18: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

SAP

SAP

SAP: software system, mainly for OLTP

SAP RFC:Remote Function Callsaccess for third party applicationskind of interface

Writing applications with ABAP/4 – access to databases withNative SQL (using special interface)Open SQL (direct access to databases)

Ronald Ortner and David Pietzka

Page 19: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

Outline

1 Reminder: NormalizationAnother Example for Normalization

2 Transactions, OLTP, OLAP, SAP, and Data WarehouseTransactionsOLTP and OLAPSAPData Warehouse & OLAP

Ronald Ortner and David Pietzka

Page 20: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

OLTP vs. OLAP

OLTP: online transaction processingDatabase applications for ongoing workExamples: orders, bookings, etc.current data is important→ many updates and changes in database

OLAP: online analytical processingDatabase applications for analysis and decision supportExample: analysis of trendshistorical data is important→ lots of data, need information in aggregated form

→ no good idea to do OLTP and OLAP on the same database system

Ronald Ortner and David Pietzka

Page 21: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

OLTP vs. OLAP

OLTP: online transaction processingDatabase applications for ongoing workExamples: orders, bookings, etc.current data is important→ many updates and changes in database

OLAP: online analytical processingDatabase applications for analysis and decision supportExample: analysis of trendshistorical data is important→ lots of data, need information in aggregated form

→ no good idea to do OLTP and OLAP on the same database system

Ronald Ortner and David Pietzka

Page 22: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

Data Warehouse

Idea of Data Warehouse:Do OLTP on operational databasesStore information from operational databases regularly(but not online!) in data warehouse

Database Scheme for Data Warehouse:Star Scheme:

Central ‘fact’ tableother tables not normalized

Snowflake Scheme:Central ‘fact’ tableother tables normalized (→ more joins necessary)

Ronald Ortner and David Pietzka

Page 23: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

Data Warehouse

Idea of Data Warehouse:Do OLTP on operational databasesStore information from operational databases regularly(but not online!) in data warehouse

Database Scheme for Data Warehouse:Star Scheme:

Central ‘fact’ tableother tables not normalized

Snowflake Scheme:Central ‘fact’ tableother tables normalized (→ more joins necessary)

Ronald Ortner and David Pietzka

Page 24: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

Data Warehouse

Idea of Data Warehouse:Do OLTP on operational databasesStore information from operational databases regularly(but not online!) in data warehouse

Database Scheme for Data Warehouse:Star Scheme:

Central ‘fact’ tableother tables not normalized

Snowflake Scheme:Central ‘fact’ tableother tables normalized (→ more joins necessary)

Ronald Ortner and David Pietzka

Page 25: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

Roll Up and Drill Down

Queries on Data Warehouse for analysis usually aggregate data(→ GROUP BY)

Drill down: more attributes in GROUP BY

Roll up: fewer attributes in GROUP BY

Data can be summarized in a cross table (data cube)

Ronald Ortner and David Pietzka

Page 26: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

Relations for Aggregation & the Cube Operator

Creating the data cube:

expensive to execute all queries for creating cube

can store relation for data cube(using NULL values where aggregated)still elaborate and uncomfortable→ idea: new SQL operator CUBEUsage: GROUP BY CUBE( attr1, attr2, . . . )Other possibility:

storing maximally drilled-down tableaggregate this table(cheaper than doing each aggregation from scratch)

Ronald Ortner and David Pietzka

Page 27: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

Relations for Aggregation & the Cube Operator

Creating the data cube:

expensive to execute all queries for creating cubecan store relation for data cube(using NULL values where aggregated)

still elaborate and uncomfortable→ idea: new SQL operator CUBEUsage: GROUP BY CUBE( attr1, attr2, . . . )Other possibility:

storing maximally drilled-down tableaggregate this table(cheaper than doing each aggregation from scratch)

Ronald Ortner and David Pietzka

Page 28: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

Relations for Aggregation & the Cube Operator

Creating the data cube:

expensive to execute all queries for creating cubecan store relation for data cube(using NULL values where aggregated)still elaborate and uncomfortable

→ idea: new SQL operator CUBEUsage: GROUP BY CUBE( attr1, attr2, . . . )Other possibility:

storing maximally drilled-down tableaggregate this table(cheaper than doing each aggregation from scratch)

Ronald Ortner and David Pietzka

Page 29: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

Relations for Aggregation & the Cube Operator

Creating the data cube:

expensive to execute all queries for creating cubecan store relation for data cube(using NULL values where aggregated)still elaborate and uncomfortable→ idea: new SQL operator CUBEUsage: GROUP BY CUBE( attr1, attr2, . . . )

Other possibility:storing maximally drilled-down tableaggregate this table(cheaper than doing each aggregation from scratch)

Ronald Ortner and David Pietzka

Page 30: Informationslogistik Unit 8: OLTP, OLAP, SAP, and Data ...institute.unileoben.ac.at/infotech/lehre/infolog/SS2012/unterlagen/... · Reminder: Normalization Transactions, OLTP, OLAP,

Reminder: Normalization Transactions, OLTP, OLAP, SAP, and Data Warehouse

Data Warehouse & OLAP

Relations for Aggregation & the Cube Operator

Creating the data cube:

expensive to execute all queries for creating cubecan store relation for data cube(using NULL values where aggregated)still elaborate and uncomfortable→ idea: new SQL operator CUBEUsage: GROUP BY CUBE( attr1, attr2, . . . )Other possibility:

storing maximally drilled-down tableaggregate this table(cheaper than doing each aggregation from scratch)

Ronald Ortner and David Pietzka