sap on db2 for linux, unix, and windows

38
internal SAP on DB2 for Linux, UNIX, and Windows Leveraging DB2 Capabilities for SAP NetWeaver BW Brigitte Bläser, IBM Arndt Effern, SAP March 2009

Upload: others

Post on 06-May-2022

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SAP on DB2 for Linux, UNIX, and Windows

internal

SAP on DB2 for Linux, UNIX, and WindowsLeveraging DB2 Capabilities for SAP NetWeaver BW

Brigitte Bläser, IBMArndt Effern, SAP

March 2009

Page 2: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 2

1. DB2 Optimized for SAP2. DB2 Storage Optimization3. DB2 Database Partitioning Feature (DPF)

3.1. Concept3.2. Integration into SAP NetWeaver BW

4. Multi-Dimensional Clustering

Agenda

Page 3: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 3

DB2 Optimized for SAP

PartnershipJoint SAP and IBM teams working on all levels of the productSAP on DB2 certification by the joint Integration Centre Toronto

Product IntegrationOne product, one maintenance strategy, one-stop serviceIBM DB2 for LUW follows SAP’s maintenance strategy

Technology InnovationJoint technology roadmap with reviewed and agreed ondeliverables

SAP runs DB2SAP’s ERP, HR, BI, and CRM are running on DB2/HP-UX1200 internal SAP systems are running on DB2

The Pillars of the „DB2 Optimized for SAP“ initiative

© SAP 2008 / Page 3 confiden tia l

DB2‘s commitment to SAP‘s 5+1+2 strategy

A unique business value for SAP customersDB2 upgrades are never required. The associated DB2 release remains in service for the enti re 5+1+2 li fecycle of the SAP appl ication .However, DB2 can a lways be upgraded at current SAP level to benefit from the technology innovationroadmap

DB2 Vx availableDB2 Vx

DB2 Vx+1

5+1+2 for DB2 Vx

DB2 Vx+1 available

© SAP 2008 / Page 3 confiden tia l

DB2‘s commitment to SAP‘s 5+1+2 strategy

A unique business value for SAP customersDB2 upgrades are never required. The associated DB2 release remains in service for the enti re 5+1+2 li fecycle of the SAP appl ication .However, DB2 can a lways be upgraded at current SAP level to benefit from the technology innovationroadmap

DB2 Vx availableDB2 Vx

DB2 Vx+1

5+1+2 for DB2 Vx

DB2 Vx+1 available

Page 4: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 4

DB2 Optimized for SAPTechnical Optimizations for SAP NW BW

DB2 Database Partitioning Feature

SAP Application Server

Database Partition 0(Catalog Partition)

Database Partition 1(Data Partition)

Database Partition n(Data Partition)

DB2 Database Partitioning FeatureShared-nothing architecture with proven linear scale-outcapabilityMature technology – used by almost all larger SAP BIcustomers on DB2

DB2 CompressionUp to 75% savings on table and index sizeTypically 50% or more savings on entire database sizeMore efficient I/O and cache utilization

DB2 Multidimensional ClusteringClustering of data along multiple dimensionsHigher selectivity when querying dataFast roll-out (delete) of data and high query performanceLess administration efforts compared to range partitioning

DB2 Integration and LicensingAll relevant DB2 features are fully supported by SAP andintegrated into SAP toolsAll relevant DB2 features are included in the SAP OEMlicense for DB2 at no extra costs

Page 5: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 5

DB2 Optimized for SAPOptimizations for SAP NW BW

Advantages of SAP NW BW on DB2 for LUW in a Nutshell

Aligned SAP/IBM maintenance strategy

One-stop service out of one hand

All DB2 database features for running a high performance SAP NW BW solutionwith lowest TCO are covered by the standard SAP OEM license for DB2 at noextra costs

Linear scale out of SAP NW BW on DB2 with the Database Partitioning Feature

Many optimizations within SAP NW BI to exploit the unique capabilities of DB2

Proven technology, already used for very large SAP NW BW Systems

SAP IT is running SAP NW BI business systems on DB2

Page 6: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 6

DB2 Optimized for SAPReference Customers

SAP NetWeaver BW 7.0 on DB2 V9.133 Database Partitions distributed over 5 Servers (pSeries, AIX)System Size: ~55TBNumber of Users: ~300 concurrentContact: Stefan Kraemer - [email protected]

SAP NetWeaver BW 7.0 on DB2 V9.110 Database Partition on one Servers (HP SuperDome, 226GB, 42Cores)System Size: ~5TBNumber of Users: ~1400Dialog Steps: ~ 275.000 per weekContact: Dr. Bernhard Wallner – [email protected]

Biggest SAP NW BW customer systems are running on DB2 for LUW*.

*as of April 2009

Page 7: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 7

1. DB2 Optimized for SAP2. DB2 Storage Optimization3. DB2 Database Partitioning Feature (DPF)

3.1. Concept3.2. Integration into SAP NetWeaver BW

4. Multi-Dimensional Clustering

Agenda

Page 8: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 8

2. DB2 Storage OptimizationDB2 Row and Index compression

Motivation for DB2 Row and Index CompressionCustomer databases are growing and a data bases sizes of >10TB is becoming commonMoney spent on storage to total hardware cost is growing

Benefit of DB2 CompressionDB2 Compression can save customers 50% and more storage per databaseDB2 Compression improves I/O bandwidth and buffer hit ration, and therefore, overallsystem performanceDB2 Compression is fully integrated in SAP (DDIC, Kernel, SAP NetWeaver BW, SAPinst,DBACOCKPIT)SAP Migration Tools utilize R3load which allows on-the-fly compression of tables whileloading

In SAP NetWeaver BW, InfoCube and Aggregate fact tables, DSO tables, and PSA tablescan be compressed by default (switch on with RSADMIN parameterDB6_ROW_COMPRESSION=YES)

Page 9: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 9

Row Compression (vmstat output)

0%

20%

40%

60%

80%

100%

0 10 20 30 40 50 60 70 80

seconds

cpu

%

idle

iow ait

sys

usr

No Compression (vmstat output)

0%

20%

40%

60%

80%

100%

0 10 20 30 40 50 60 70 80 90

seconds

cpu

%

idle

iow ait

sys

usr

Less I/O cycles

More user cycles(compression)

Overall PerformanceSignificantly Improved

2. DB2 Storage Optimization

14159rows/page

0.0002220.000048user cpu time/page

0.000001580.00000082user cpu time/row

67950302878Time waited for prefectch

94.49048.910Total user cpu time (sec.ms)

76.97287.847MB/sec

43.26890.993Run time (secs)

33307993MB

4262921023162# of Pages

59,986,05259,986,052# of Rows

Row CompressionNo CompressionTablescan

14159rows/page

0.0002220.000048user cpu time/page

0.000001580.00000082user cpu time/row

67950302878Time waited for prefectch

94.49048.910Total user cpu time (sec.ms)

76.97287.847MB/sec

43.26890.993Run time (secs)

33307993MB

4262921023162# of Pages

59,986,05259,986,052# of Rows

Row CompressionNo CompressionTablescan

Page 10: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 10

2. DB2 Storage OptimizationDBA Cockpit

Page 11: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 11

2. DB2 Storage Optimization

Page 12: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 12

1. DB2 Optimized for SAP2. DB2 Storage Optimization3. DB2 Database Partitioning Feature (DPF)

3.1. Concept3.2. Integration into SAP NetWeaver BW

4. Multi-Dimensional Clustering

Agenda

Page 13: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 13

3.1 DB2 Database Partitioning Feature (DPF)Concept

Data distribution with hash partitioningSupport of multiple database partitions onmultiple database servers

Each database partition uses its own localattached storage (Shared Nothing Architecture)

Each database partition uses its own memoryareas (buffer pools, sortheap, locklist,...)

Each database partition uses its own set of DB-Parameters

Parallel query processing for near-linearscalability

DB2 Database Partitioning Feature

SAP Application Server

Database Partition 0(Catalog Partition)

Database Partition 1(Data Partition)

Database Partition n(Data Partition)

Page 14: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 14

3.1 DB2 Database Partitioning Feature (DPF)Concept

Database Server 1

CPU CPU CPU CPU

Memory

Partition 0 Partition 1

Communication Facility

Distributed Table 1

Database Server 2Fast Communication

CPU CPU CPU CPU

Memory

Partition 2 Partition 3

Communication Facility

Distributed Table 2

Database partitions can be createdLocally on one database server (Logical Partitioning)On several database servers (Physical Partitioning)

Tables can be distributed over all or a subset of the existing database partitionsTable data is distributed based on a distribution key defined when a table is created

Page 15: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 15

Partition 0

Hash Value 0 1 2 3 4 5 6 7 8 9 10 11 ...

Partition 1 Partition 2

Partition 0 1 2 3 0 1 2 3 0 1 2 3 ...

User ID Name Street City

4711 Joe Smith Hillstreet London

Hash Value „6“assigned to Partition 2

Distribution Key

Distribution Map

Distribution Key valuehashed to value „6“

3.1 DB2 Database Partitioning Feature (DPF)Concept

Page 16: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 16

SELECT ... FROM ...

Database Server 1 Database Server 2

Fast Communication

Inter-partitionParallelism

Distributed Table e.g. InfoCube, Aggregate, ODS, PSA

Partition 0 Partition 1 Partition 2 Partition 3

pro-cess

SELECT...FROM...

CPU

pro-cess

SELECT...FROM...

CPU

pro-cess

SELECT...FROM...

CPU

pro-cess

SELECT...FROM...

CPU

A coordinating agent splits thequery into sub queries, one foreach database partition.

Each sub query onlyprocesses the subset of thetable data that is located on aparticular database partition.

A single SQL query can onlydeploy all available CPUs ifone database partition isconfigured for each CPU.

3.1 DB2 Database Partitioning Feature (DPF)Concept

Page 17: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 17

Advantages of the DB2 Database Partitioning FeatureNear-linear scalability

Start with small DB server and add CPU and memory resources as needed

Or start with one DB server and add additional DB servers as needed

Better CPU utilization through parallel query execution

Reduction of time for maintenance operations

Parallel backup of all database partitions reduces backup time

Parallel index creation on all partitions where table is located

Parallel table reorganization on all partitions where table is located

Statistics collection only takes place on first partition where table is located

3.1 DB2 Database Partitioning Feature (DPF)Concept

Page 18: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 18

3.2 DB2 Database Partitioning Feature (DPF)Integration into SAP NW BW

The following tables can be distributed over several database partitionsInfoCube and Aggregate fact tables

DSO tables

PSA tables

The following tables do not require distribution over database partitionsDimension tables

Master data tables

SAP Basis tables

SAP NetWeaver BI administration tables (RS…)

Distribution keys are created automatically when InfoCube, DSO or PSA table are activated

Data inserted into fact, DSO and PSA tables is distributed automatically over the databasepartitions on which the tables are located

Page 19: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 19

Installing SAP NetWeaver BI system with DB2 multi-partition databaseUse SAPinst to install SAP NetWeaver with one database partition (databasepartition 0)

Use SAPinst to add additional database partitions on the same server or onadditional servers (database partitions 1 to <n>)

Either Distribute tablespaces for InfoCube/Aggregate fact tables, DSO tables, andPSA tables over database partitions 1 to <n> (BI data distribution wizard in DBACockpit)

Or create additional tablespaces for InfoCube/Aggregate fact tables, DSO tables,and PSA tables on partitions 1 to n or a subset of the partitions and create dataclasses associated with these tablespaces (via DBA Cockpit)

3.2 DB2 Database Partitioning Feature (DPF)Integration into SAP NW BW

Page 20: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 20

DB2 Database after Installing the First Database Partition

DB Server n

Fast Communication

DB Partition 0

DB Server2

SAPApplication

Server

Dimensiontablespace

SAP basis andmaster datatablespaces

DefaultFact tablespace

Default PSA andDataStoretablespace

…SAP

ApplicationServer

SAPApplication

Server

DB Server 1

3.2 DB2 Database Partitioning Feature (DPF)Integration into SAP NW BW

Page 21: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 21

Adding Additional DatabasePartitions with SAPinst

3.2 DB2 Database Partitioning Feature (DPF)Integration into SAP NW BW

Page 22: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 22

Adding Additional DatabasePartitions with DBA Cockpit

3.2 DB2 Database Partitioning Feature (DPF)Integration into SAP NW BW

Page 23: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 23

DB Server n

Fast Communication

DB Partition0

DB Server 2

SAPApplication

Server

DimensionTablespace

SAP Basis andMaster DataTablespaces

…SAP

ApplicationServer

SAPApplication

Server

DB Server 1

DB Part. l DB Part. mDB Part. 1 DB Part. k… …

Distributed Fact Tablespace

Distributed PSA and DataStore Tablespace

3.2 DB2 Database Partitioning Feature (DPF)Integration into SAP NW BW

DB2 Database after Installing all First Database Partition

Page 24: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 24

Creating new InfoCube with fact tables distributed over several databasepartitions

In the Data Warehousing Workbench, choose “Extras – DB Performance – Maintain DB-Storage Parameters” and select a data class for the fact tables (and optionally for theAggregate fact tables) that is associated with a tablespace distributed over severaldatabase partitions

Activate the InfoCube

When the fact tables are created in the database a distribution key consisting of thedimension key columns except for the package dimension key is added automatically

When InfoPackages are loaded into the InfoCube the fact table data is distributedautomatically evenly over the database partitions

3.2 DB2 Database Partitioning Feature (DPF)Integration into SAP NW BW

Page 25: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 25

3. DB2 Database Partitioning Feature (DPF)3.2 Integration into SAP NetWeaver BW

Creating Infocubes on Several Database Partitions

Page 26: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 26

Creating a new DSO with tables distributed over several database partitionsIn the Data Warehousing Workbench, choose “Extras – DB Performance – Maintain DB-Storage Parameters” and select a data class for the Active Table and the Change LogTable that is associated with a tablespace distributed over several database partitions.Optionally select a different data class for the Activation Queue Table.Activate the DSOWhen the DSO tables are created in the database a distribution key is added automaticallywhich consists of

The DSO key fields for the active tableThe RECORD column for the Change Log and Activation Queue Tables

When InfoPackages are loaded into the DSOThe data of each InfoPackage is distributed automatically evenly over the databasepartitions for the Activation Queue TableThe data stored in the DSO is distributed automatically evenly over the databasepartitions of the Active TableThe records of each request generated during data activation is distributedautomatically evenly over the database partitions of the Change Log Table

2 DB2 Database Partitioning Feature (DPF)3.2 Integration into SAP NetWeaver BW

Page 27: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 27

Creating DSO Objects on Several Database Partitions

3. DB2 Database Partitioning Feature (DPF)3.2 Integration into SAP NetWeaver BW

Page 28: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 28

Creating a new DataSource where the PSA table is distributed overseveral database partitions

In the Data Warehousing Workbench, choose “Goto – Technical Attributes”and select a data class for the PSA table that is associated with a tablespacedistributed over several database partitions.

Activate the DataSource

When the PSA table is created in the database a distribution key consistingof the RECORD column is added automatically

When InfoPackages are loaded into the PSA table the data of eachInfoPackage is distributed automatically evenly over the database partitions

3. DB2 Database Partitioning Feature (DPF)3.2 Integration into SAP NetWeaver BW

Page 29: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 29

Creating PSA Tables on Several Database Partitions

3. DB2 Database Partitioning Feature (DPF)3.2 Integration into SAP NetWeaver BW

Page 30: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 30

1. DB2 Optimized for SAP2. DB2 Storage Optimization3. DB2 Database Partitioning Feature (DPF)

3.1. Concept3.2. Integration into SAP NetWeaver BW

4. Multi-Dimensional Clustering

Agenda

Page 31: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 31

MDC organizes table data along one or more columns defined as MDCdimensions

Records with the same values in one or more columns are stored physically together inblocks of pagesBlocks correspond to tablespace extentsMDC block indexes point to blocks instead of single rowsImproves query performance for more than one key column (MDC dimensions)

Example

EAST,2005 WEST,2005 WEST,2006

Region

Year

SELECT * FROM Sales WHERE Region = WEST

2 big block I/Os to retrieve pages containing region WEST

All sequential I/O (efficient)

SELECT * FROM Sales WHERE Year = 2005

2 big block I/Os to retrieve pages containing year 2005

All sequential I/O (efficient)

Multi-Dimensional Clustering

Page 32: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 32

MDC fast insert: Reduced LockingEnabled by setting LOCKSIZE parameter of an MDC table to BLOCKINSERT(during table creation or by ALTER TABLE)

Locks MDC blocks instead of single rows

MDC fast deleteMarks pages as deleted instead of single rows

Asynchronous cleanup of additional RID indexes in the background (DB2 V9.5)increase performance of large DELETE operations

Block indexes are smaller than RID indexes -> Index maintenance reduced

Multi-Dimensional Clustering

Page 33: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 33

MDC is supported for PSA, DataStore objects, InfoCubes and Aggregates

MDC can be combined with DPF

MDC for PSA and PSA-like tables automatically enabled on column REQUEST (enabledwith RSADMIN parameter DB6_MDC_FOR_PSA=YES)

Manual selection of MDC dimensions for InfoCube Fact tables and Active Table ofDataStore objects in Data Warehousing Workbench (soft limit of 3 MDC dimensions to avoidexcessive space consumption)

Re-clustering tool to convert existing InfoCubes / DataStore objects to MDC (re-clusteringcan be combined with DB2 row compression)

Disk space consumption test in SAP NetWeaver BI transaction RSRV

MDC Advisor in DBA Cockpit for InfoCubes and DSO

Multi-Dimensional Clustering

Page 34: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 34

In the Edit InfoCubescreen, select Extras –DB Performance -Clustering from menu

The dialog Selection ofClustering is displayed

SelectMulti-DimensionalClustering

Multi-Dimensional Clustering

Page 35: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 35

Decide whether to select thePackage dimension on the Ffact table

Optionally select a timecharacteristic or the timedimension in the TimeDimension box

Optionally select additionaldimensions in the Char.Dimension box by enteringconsecutive numbers in theStat.No. fields

If you select time it will bethe first MDC dimension

Multi-Dimensional Clustering

Page 36: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 36

Select ‘Extras’ – ‘DBPerformance’ – ‘Clustering’from the menu in ‘EditDataStore Object’ dialog

The MDC dialog forDataStore objects isdisplayed

Multi-Dimensional Clustering

Page 37: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 37

The MDC dialog lists thekey InfoObjects

Select MDC dimensionsby entering consecutivenumbers starting with 1 inthe Stat.No. fields

The numbers determinethe MDC dimension order

Multi-Dimensional Clustering

Page 38: SAP on DB2 for Linux, UNIX, and Windows

© SAP 2008 / Page 38

References

News, Blogs, Backgrounds, Docs about SAP on DB2: https://www.sdn.sap.com/irj/sdn/db6SAP NetWeaver Business Intelligence 7.00 and Higher – Administration Tasks: IBM DB2 forLinux, UNIX, and Windows, http://service.sap.com/instguides (in folder “Operations” =>“Database-Specific Guides”)

Infrastructure Solutions: Design, Manage, and Optimize a 20 TB SAP NetWeaver BusinessIntelligence Data Warehouse, IBM Redbook, SG247289, 2007,http://www.redbooks.ibm.com/abstracts/sg247289.html?Open

Infrastructure Solutions: Design, Manage and Optimize a 60 TB SAP NetWeaver BusinessIntelligence data warehouse, IBM Redbook, SG247385, 2007,http://www.redbooks.ibm.com/abstracts/sg247385.html?Open

Building and Scaling SAP Business Information Warehouse on DB2 UDB, IBM Redbook,SG247094, 2004, http://www.redbooks.ibm.com/abstracts/sg247094.html?Open