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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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