Вы находитесь на странице: 1из 56

DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW

Lab Exercise Hand Book

WW DB2 SAP TECHNICAL ENABLEMENT AND SUPPORT TEAM

DB2 LUW for SAP BW Lab Exercises

Exercise Overview

Unit 1 – DB2 LUW Administration in General

1 Get familiar with DBACockpit

1 Understand DB2 database Key Performance Indicators (KPIs)

1 Understand DB2 configuration

1 Get familiar with “Single Table Analysis” feature

1 Buffer pool and table space maintenance

1 Use db2look tool

Unit 2 – BI Objects in DB2

7

System overview in Data Warehousing Workbench

7

Find the database table name for a InfoCube

7

Check Fact table storage parameters

7

Schema Viewer for InfoCubes

7

Fact table analysis

7

Find the database table name for a DataStore Object

7

Check ODS table storage parameters

7

Check ODS table structure

7

Find the database table name for a PSA table

7

Check PSA table storage parameters

7

Check PSA table structure

7

Find the InfoObject and Master Data Tables

Unit 3 – Scale out SAP BW database

19

Create new partition group

19

Create new table spaces which are mapped to new data classes

19

Create a new InfoArea and a new InfoCube that is stored in new table spaces

19

Load data to the InfoCube

19

Add a new partition

19

Redistribute the InfoCube fact table to the new partition

19

Drop a partition

Unit 4 – BI Query Analysis

26

Run BI query through RSRT query monitor

27

Use BI Query Visualizer to analyze the query

26

Analyze query access plan

26

Collect optimizer data for query performance analysis

Unit 5 – MDC for SAP BW

30 Convert an existing fact table to MDC table

31 Check Fact table storage parameters

32 Run query against the new fact table

33 Compare the query performance and analyze the new access plan

34 Check BI parameters related to MDC usage

DB2 LUW for SAP BW Lab Exercises

Unit 6 – Deep Compression for SAP BW

35

Compress an existing fact table

35

Check new table size

35

Run query against the new fact table

35

Analyze the new access plan

35

Check DB2 compression related BI parameter

Unit 7 – BI Operations

36 Compress an InfoCube

37 Run query against a compressed InfoCube

38 Create an aggregate

39 Check aggregate table structure and storage parameters

40 Run query against an aggregated InfoCube

DB2 LUW for SAP BW Lab Exercises

Unit 1 – DB2 LUW Administration in General

 

System ID

: N4S

Database server

: n4shost

1.1 Logon data

System number

: 42

User ID

: bwuser

 

Password

: sapn4sadm

 

Run transaction DBACockpit (or ST04), and found out the following KPIs:

1.2 Understand DB2

1. buffer pool quality on database level and on each table space level?

database Key Per- formance Indicators (KPIs)

2. package cache and catalog cache quality, any cache overflow?

3. any lock escalation and dead locks?

4. any sort overflow?

 

Find out the following DB2 configuration information:

1. what is the value for the registry variable DB2_WORKLOAD?

2. what is the value for the database manager (DBM) configuration pa- rameter INSTANCE_MEMORY?

1.3

configuration

Understand DB2

3. what is the value for the database (DB) configuration parameter DA- TABASE_MEMORY?

4. what is the TCPIP port number used by db2 instance? – check SVCE- NAME configuration parameter

 

DBACockpit -> Space -> Single Table Analysis, type in Table name “/BIC/FZSD_C01”, hit Enter

1.4

Get familiar with

1.

what’s the table size? How many rows (cardinality)?

“Single Table

2.

when was the last time the table statistics was collected?

Analysis” feature

3.

how many indexes have been defined?

4.

check table structure, index structure

 

1.

create a new buffer pool “BP32K” with 32K page size and 100 pages Note: due to a bug in DBACockpit -> Configuration -> Buffer Pools -> Add, we have to create this buffer pool from DB2 command line: db2 "create bufferpool bp32k size 100 pagesize 32k"

2.

1.5

Buffer Pool and

Table space mainte- nance

3.

Add a table space “myspace” from DBACockpit, with automatic stor- age feature, 32K page size and assign BP32K to it

enable DIO by altering table space to NO FILE SYSTEM CACHING – on DB2 command line, db2 "alter tablespace myspace no file system caching"

4.

delete the tablespace “myspace” and the buffer pool “BP32K” from DBACockpit.

 

1.

Retrieve the current layout of the database: db2look -d n4s -l > db_layout.txt

1.6

Use db2look tool

2.

Retrieve the definition and statistics of a SAP BW specific table, e.g. “/BIC/FZSD_C01”: db2look -d n4s -u sapn4s -z SAPN4S -e -m -t "/BIC/FZSD_C01" > zsd_c01.txt

DB2 LUW for SAP BW Lab Exercises

Unit 2 – BI Objects in DB2

 

Run transaction RSA1: Data Warehouse Workbench On the left navigation panel, select Modelling InfoProvider “benchmark”

This will give you an over view of which InfoProviders will be used in the lab.

This will give you an over view of which InfoProviders will be used in the lab.

2.1

System

overview

 

Run transaction RSA1 Modeling InfoProvider Select “benchmark” Select

2.2

Find the

database table name for a InfoCube

“Benchmarkcube” and right-click Select “Manage” Select “Contents” tab Select button “Fact Table” Table name is shown in header line.

Select “Manage” Select “Contents” tab Select button “Fact Table” Table name is shown in header line.
 

Run transaction SE14. Enter table name: /BIC/FZSD_C01 Edit

On this screen, you can

use “Indexes…” button to see all indexes defined on this fact table,

use “Storage Parameters” button to check DB2 specific storage parameters,

use “Check…” button to verify the consistency between SAP data dictionary

2.3

Check

(DDIC) and physical database table.

Fact table

storage pa-

rameters

DB2 LUW for SAP BW Lab Exercises

 
 
 

To check the table structure use button “Storage Parameter.” From here you can find the partitioning key definition, and which index is defined as clustering index.

2.4 Check

2.4 Check

storage pa-

rameter

DB2 LUW for SAP BW Lab Exercises

Run transaction LISTSCHEMA. Enter Info Cube name: ZSD_C01 Execute The extended star schema for this
Run transaction LISTSCHEMA. Enter Info Cube name: ZSD_C01 Execute
The extended star schema for this InfoCube, including fact table, all dimension tables
and master data tables, are displayed.
2.5
Schema
Viewer for
InfoCubes
Run transaction DBACockpit, go to Space Single Table Analysis, enter table name
“/BIC/FZSD_C01” and hit Enter
2.6
Fact table
analysis
Check table and index statistics, table and index structure, etc.
Write down the Total Table Size, Total Index Size and No. of Pages
with Data to the Work Sheet on the final page of this hand book.

DB2 LUW for SAP BW Lab Exercises

 

Run transaction RSA1 Modeling InfoProvider Select “benchmark” Select “odsbench” and right-click Select “Manage” Select “Contents” tab:

2.7

Find the

Select button “New Data” ODS activation queue table name is shown in head- ing: /BIC/AODSBENCH40 Select button “Active Data” ODS active table name is shown in heading:

/BIC/AODSBENCH00

database table name for a DataStore Object

Select button “Change Log” ODS change log table name is shown in heading:

 

/BIC/B0000002000

2.8

Check

 

ODS table

In SE14, enter table name /BIC/AODSBENCH40, /BIC/AODSBENCH00, and

/BIC/B0000002000

storage pa-

Find out their partitioning keys, indexes, etc.

rameters

2.9

Check

In DBACockpit -> Space -> Single Table Analysis, enter table name /BIC/AODSBENCH40 and /BIC/AODSBENCH00 Find out their table and index structures, statistics, etc.

ODS table

structure

 

In order to find out the PSA table name, go to SE16, enter table name RSTSODS, click Enter. On the Data Browser screen, enter “ZBENCH*” in the field ODSNAME, click Exe- cute button.

2.10 Find the database table name for a PSA table

2.10 Find the database table name for a PSA table

One record is found:

DB2 LUW for SAP BW Lab Exercises

 
 

From here we can see the PSA table name is “/BIC/B0000020000”.

2.11

Check

 

PSA table

In SE14, enter table name “/BIC/B0000020000”, find out their partitioning keys and index definition.

storage pa-

rameters

 
 

In DBACockpit -> Space -> Single Table Analysis, enter table name

2.12

PSA table

structure

Check

“/BIC/B0000020000”

Find out their table and index structures, statistics, etc.

 

Run transaction RSA1 Modeling InfoObjects Unassigned Nodes Unas- signed Characteristics Search for “Customer Number” and double click.

2.13

Find the

What master data tables have been created for InfoObject 0CUSTOMER? Write down the SID table name, and other master table names.

InfoObject

and Master

Data Tables

 

Use SE14 and Single Table Analysis to check each table. You can also use SE16 to display table contents.

DB2 LUW for SAP BW Lab Exercises

Unit 3 – Scaling out SAP BW database

 

Prerequisites:

There is a bug in this version of the SAP/DB2 Test Drive DVD, which causes the BI Data Distribution Wizard to run under a userid with insufficient authority to alter tablespaces. The work around is to grant sapn4s SYSADM authority, by running the following command as root user:

usermod -g dbn4sadm sapn4s

Preparation for scaling out database:

3.1

Create a new da-

1. In the SAP GUI, open transaction dbacockpit and click Configuration -> Database Partition Groups. Click the Add button, and enter NGRP_FACT_NEW for the name, then click the Add button at the top of the screen and confirm the creation. By default, this new parti- tion group will include all partitions available. At this time, there is only one partition – partition 0.

tabase partition group

3.2

Create new table

 

spaces

2. Click Space -> Tablespaces to view the list of tablespaces. Click the Add button, and enter NEW#FACTD as the tablespace name, and se- lect NGRP_FACT_NEW as the partition group and 16K page size. Ensure AutoStorage is selected and then click the Add button at the top of the screen to create this new tablespace; repeat the same steps to create another table space NEW#FACTI, make sure to select NGRP_FACT_NEW as the partition group and 16K pagesize.

3.3

Create a new data

class

3. Click Configuration -> Data Classes to add a new data class. Click the Add button, and enter ZFACT as the Data Class name with the de- scription “New Fact Tables”, and select NEW#FACTD as the Data Tablespace, NEW#FACTI as the Index Tablespace. Then click the Add button to create this data class.

as the Data Tablespace, NEW#FACTI as the Index Tablespace. Then click the Add button to create

DB2 LUW for SAP BW Lab Exercises

3.4

Create a new In-

Run transaction RSA1 Modeling InfoProvider

foArea

Right click on the header of the column “InfoProvider”, and choose “Create InfoArea…”.

“InfoProvider”, and choose “Create InfoArea…”. 3.5 Create a new In- Right click on the “My

3.5

Create a new In-

Right click on the “My InfoArea”, and select “Create InfoCube”.

foCube by copying the existing Info- Cube ZSD_C01

On the “Edit InfoCube” pop-up window, change the InfoCube name to “ZSD_C02”, enter the description, select the “Copy From” cube as “ZSD_C01”, and click “Create” button.

cube as “ZSD_C01”, and click “Create” button. Back on the DW workbench screen, go to Extra

Back on the DW workbench screen, go to Extra DB Performance Main- tain DB-Storage Parameters,

On the “Maintain Storage Parameters” screen, change the Data Type of both InfoCube and Aggregate to the new data class “ZFACT” and click on Continue button.

*Note* if you don’t see ZFACT being displayed in the drop-down list, you might have to run a transaction /$SYNC to refresh the SAP table buffer. It seems to be an error in buffer synchronization for table DDART.

On the DW workbench, click Activate button to activate the new InfoCube.

Click Save button to save all changes. You will notice the InfoCube object

DB2 LUW for SAP BW Lab Exercises

 

status is changed from Active to Inactive after it’s saved. You need to reactivate the InfoCube by clicking Activate button again.

3.6 Create a new DataSource

Run transaction RSA1 Modeling DataSources On DataSource “benchmark zbench”, right click, and select “Copy…” Enter Targe DataSource name “ZBENCH_ZSD_C02”, and select Source Sys- tem “BENCH”, then click OK button

select Source Sys- tem “BENCH”, then click OK button On the “Change DataSource ZBENC_ ZSD_C02(BENCH)” screen,

On the “Change DataSource ZBENC_ZSD_C02(BENCH)” screen, under “General Info” tab, change all descriptions to “zbench_zsd_c02”:

tab, change all descriptions to “zbench_zsd_c02”: under “Extraction” tab, select the Adapter “Load

under “Extraction” tab, select the Adapter “Load Text-Type File from Applica- tion Server”, and enter te File Name

DB2 LUW for SAP BW Lab Exercises

“/usr/sap/trans/bwbench/data/sd_c01_trans1.txt”:

“/usr/sap/trans/bwbench/data/sd_c01_trans1.txt”: Go to the “Proposal” tab. On the rows for column

Go to the “Proposal” tab. On the rows for column “Field Name” with values “VERSION”, “SOLD_TO”, “MATERIAL” and “BASE_UOM”, change corresponding “Format” column value to “External”.

Click Activate button to activate this DataSource. Accept the prompt of warning message.

You can test the DataSource by using “Read Preview Data” under the “Pre- view” tab.

On the newly created DataSource “zbench_zsd_c02”, right click, choose “Cre- ate Transformation…” On the “Create Transformation” screen, select Object Type “InfoCube” and enter the Name “ZSD_C02”. Hit Enter.

3.7 Create Trans- formation

Name “ZSD_C02”. Hit Enter. 3.7 Create Trans- formation On the “Transformation Creat” screen, if you hit

On the “Transformation Creat” screen, if you hit Ctrl-F2, or choose menu item Transformation Check, you will see the Log Display screen which shows a number of error messages.

DB2 LUW for SAP BW Lab Exercises

This is because these target fields need to be associated with either a unit or
This is because these target fields need to be associated with either a unit or a
currency. On the field mapping window, right click on the link that leads to one
of these target field, e.g. OCRMEM_CST, select Rule Details.
On the Rule Details screen, use the drop-down list for the field “Source Cur-
rency” to select “STAT_CURR” for the Source Currency, then click on button
Transfer Values.

DB2 LUW for SAP BW Lab Exercises

For the target fields that require a Source Unit, select “BASE_UOM” as the Source Unit.
For the target fields that require a Source Unit, select “BASE_UOM” as the
Source Unit.
Repeat this step for every target field that requires either a Source Currency or a
Source Unit, until Ctrl-F2 check returns no error (you can ignore three warning
messages regarding 0CALMONTH, etc.)
Click on Activate button to activate this Transformation.
3.8 Create InfoPack-
age
On the newly created DataSource “zbench_zsd_c02”, right click, choose “Cre-
ate InfoPackage…”
On the Create InfoPackage screen, enter the description “InfoPackage for trans1
data file”
Click on Save button.

DB2 LUW for SAP BW Lab Exercises

3.9 Load data to PSA

Double click on the newly created InfoPackage, choose “Schedule” tab, and click Start button to Start Data Load Immediately.

You can use SM37 in another SAP GUI window to monitor the job execution. (If you click on Job(s) button on the InfoPackage screen, you need to change the job name from “BI_BTCH*” to “BI_REQ*”. )

 

On the newly created DataSource “zbench_zsd_c02”, right click, choose “Cre- ate Data Transfer Process…” On the “Creation of Data Transfer Process” screen, enter the name of the DTP “ZBENCH_ZSD_C02”, and then choose the Target of DTP Object Type “Info- Cube” and Name “ZSD_C02”. Click Coutinue button.

Cube” and Name “ZSD_C02”. Click Coutinue button. On the “Creation of Data Transfer Process” window ,

On the “Creation of Data Transfer Process” window, click Activate button to activate this DTP.

3.10

Create a Data

Transfer Process

(DTP)

 

On the “Display Data Transfer Process” screen, choose “Execute” tab, and click on Execute in the Background button,

3.11

Load data to

Click Yes to the question “Do you want to display the request monitor?”.

the InfoCube

ZSD_C02

On the Data Transfer Process monitor screen, click Refresh button to check job status until the job is completed.

3.12

Check

Run transaction DBACockpit Space Single Table Analysis, Enter table name “/BIC/FZSD_C02”, hit Enter Click button “RUNSTATS in Dialog”, after the runstats finishes, you should see the table Cardinality is 13640.

ZSD_C02 Fact table

3.13

Add a new par-

Before adding a partition, check the current partition configuration:

tition

DB2 LUW for SAP BW Lab Exercises

n4shost:db2n4s 51> cat db2/db2n4s/sqllib/db2nodes.cfg 0 n4shost 0

This shows currently there is only one partition.

Before adding a new partition, we should log off SAP GUI and stop SAP first.

n4shost:n4sadm 52> stopsap

Make sure DB2 instance is stopped. Otherwise you could force to stop DB2 instance:

n4shost:n4sadm 52> db2stop force

Then, open a new terminal window under user “root”, go to the directory /storage/sapinst, and launch sapinst program:

n4shost:~ # cd /storage/sapinst n4shost:/storage/sapinst # ./sapinst

# cd /storage/sapinst n4shost:/storage/sapinst # ./sapinst On sapinst screen, select the service SAP NetWeaver 7.0

On sapinst screen, select the service SAP NetWeaver 7.0 Support Release 3 -> Software Life-Cycle Options -> Database Tools -> IBM DB2 for Linux, UNIX, and Windows -> Additional Database Partitions.

Click on Next button. On the following sapinst screen, enter the corresponding

DB2 LUW for SAP BW Lab Exercises

input values for:

Profile Directory = /sapmnt/N4S/profile Connect User ABAP = sapn4s Password of SAP System Administrator = passw0rd Password of Database Administrator = passw0rd Password of ABAP Connect User = passw0rd Number of Additional Partitions = 1 Database Memory [MB] = 1000

Click Next button on the Parameter Summary screen, and the spainst starts to run. At the end, you should receive the following screen saying “Additional Database Partitions has been completed successfully.”. Click OK to exit sapinst screen.

completed successfully.”. Click OK to exit sapinst screen. Now you can check the current partition configuration:

Now you can check the current partition configuration:

n4shost:~ # su - db2n4s

n4shost:db2n4s 51> cat /db2/db2n4s/sqllib/db2nodes.cfg

0 n4shost 0

1 n4shost 1

This shows the partition 1 has been added.

After the partition 1 has been added, we need to change some configuration pa- rameter values in order to run the work loads in the following lab exercises.

n4shost:db2n4s 53> cd /storage/scripts n4shost:db2n4s 55> db2 -tvf update_db_cfg_node1.clp !mkdir /db2/N4S/log_dir/NODE0001 mkdir: cannot create directory `/db2/N4S/log_dir/NODE0001':

File exists

update dbm cfg using instance_memory 250000

DB2 LUW for SAP BW Lab Exercises

DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed successfully.

alter bufferpool ibmdefaultbp size 8000 AUTOMATIC DB20000I The SQL command completed successfully.

update db cfg for n4s using SORTHEAP 128 AUTOMATIC SHEAP- THRES_SHR AUTOMATIC LOCKLIST 1200 AUTOMATIC MAXLOCKS AUTO- MATIC PCKCACHESZ 20000 AUTOMATIC DATABASE_MEMORY AUTOMATIC SELF_TUNING_MEM OFF CATALOGCACHE_SZ 2560 LOGBUFSZ 1024 DLCHKTIME 300000 LOGFILSIZ 16380 LOGPRIMARY 3 LOGSECOND 40 NEWLOGPATH /db2/N4S/log_dir BLK_LOG_DSK_FUL YES AUTO_STMT_STATS ON DB20000I The UPDATE DATABASE CONFIGURATION command com- pleted successfully. SQL1363W One or more of the parameters submitted for imme- diate modification were not changed dynamically. For these configuration pa- rameters, all applications must disconnect from this database before the changes become effective.

terminate DB20000I The TERMINATE command completed successfully.

n4shost:db2n4s 56> db2stop

 

01/27/2009 13:18:40 successful.

0

0

SQL1064N DB2STOP processing was

01/27/2009 13:18:45 successful.

1

0

SQL1064N DB2STOP processing was

SQL1064N DB2STOP processing was successful.

We are going to restart SAP system as user n4sadm.

First of all, since NW07 SR3 remove the environment variable DB2DB6EKEY, we need to regenerate the user password file as below:

n4shost:n4sadm 65> dscdb6up -create passw0rd passw0rd

password file '/usr/sap/N4S/SYS/global/dscdb6.conf' successfully written

Now restart SAP:

n4shost:n4sadm 52> startsap

 

Because the additional partition will need to use additional resource (CPU and memory), you might notice that the SAP system becomes slower than before.

DB2 LUW for SAP BW Lab Exercises

3.14

Check current F

Firstly, let’s check the current data distribution of the fact table

/BIC/FZSD_C02.

fact table data distri- bution

Log on SAP GUI with user bwuser.

 

Goto DBACockpit -> Diagnostics -> SQL Commands, enter the following SE- LECT statement:

select dbpartitionnum(key_zsd_c02p) as partitionnum, count(*) from "/BIC/FZSD_C02" group by dbpartition-

num(key_zsd_c02p)

 

the following result returned, which means all 13640 records in this fact table are located in partition 0.

----------- -----------

 

0

13640

1

record(s) selected.

 

Goto DBACockpit -> Wizards -> BI Data Distribution, click continue to begin.

 

1. Add partition 1 to the NGRP_FACT_NEW partition group and click continue.

2. Accept the default location for the temporary tablespace and click con- tinue again.

3.15

Redistribute the

3. Check Start Immediately, and then click continue.

existing table data to

4. Review the redistribution procedure summary and then click execute to start the redistribution process.

the new partition

This will run the script to create a system temporary tablespace container on the new partition, add the new partition into the partition group, and then redistrib- ute the data to all existing and new partitions. You can go to Jobs -> DBA Log or SM37 to view the job log.

 

After the job is completed successfully, check the new data distribution.

Goto DBACockpit -> Diagnostics -> SQL Commands, enter the following SE- LECT statement:

select dbpartitionnum(key_zsd_c02p) as partitionnum, count(*) from "/BIC/FZSD_C02" group by dbpartition-

3.16

Check new F

num(key_zsd_c02p)

 

fact table data distri- bution

It should return the result similar to below:

----------- -----------

 

0 6896

1 6744

2

record(s) selected.

This result indicates that total 13640 records have been more or less evenly distributed to two partitions – 0 and 1. Keep in mind, the distribution might not be exactly even, but should not be skewed.

DB2 LUW for SAP BW Lab Exercises

3.17

Remove the

 

newly added parti- tion from the parti- tion group

The following steps show how to remove a partition. Before we can remove the partition 1, we have to move the data located in partition 1 to other partitions. For this, we can use the BI Data Distribution wizard again, to remove partition 1 from the partition group NGRP_FACT_NEW.

 

Click the Yellow up-arrow to exit the dbacockpit completely, and then return back into the dbacockpit, to the BI Data Distribution Wizard, click continue

1. remove the partition 1 from the NGRP_FACT_NEW partition group

2. accept the defaults on the next two screens and just click continue.

3.18

Redistribute the

3. check Start Immediate, and then click continue one last time.

data back across the remaining partitions in the partition group

You can go to Jobs -> DBA Log or SM37 to view the job log. You can now verify the data has been redistributed back to partition 0 only.

Goto DBACockpit -> Diagnostics -> SQL Commands, enter the following SE- LECT statement:

n4shost:1> select dbpartitionnum(key_zsd_c02p) as parti- tionnum, count(*) from "/BIC/FZSD_C02" group by dbparti-

tionnum(key_zsd_c02p)

----------- -----------

0

13640

1 record(s) selected.

 

Dropping the partition from the database manager cannot be done from within SAP. Once the preceding redistribute finishes, logon to n4shost as db2n4s, and

3.19

Remove the

run the following command to verify which partitions are still in use by the da- tabase:

partition from the

database manager

db2 drop dbpartitionnum verify

Since you have previously removed your new partition from all partition groups and redistributed the data off of that partition, you should not see your new par- tition in this list.

3.20

Confirm the

Completely logoff of SAP GUI, and run stopsap as n4sadm to stop SAP on the server. This prevents the SAP work processes from reconnecting to the data- base and causing problems while DB2 is dropping the partition. Then, switch to the db2n4s userid, and run the following command, to drop the partition from the database manager:

db2stop drop dbpartitionnum 1

partition removal and data distribu- tion, and restart sap

Again, cat /db2/db2n4s/sqllib/db2nodes.cfg, to verify that the partition has been removed, and then run startsap as the n4sadm userid, to restart SAP and DB2.

DB2 LUW for SAP BW Lab Exercises

 

Unit 4 – BI Query Analysis

4.1

Query

In DBACockpit -> Performance -> SQL Cache, Set Selection Criteria “Average Execution Time” >= 1000 ms, Sort statements by Avg. Execution Time, pick an expensive statement and click on Ex- plain button to display its access plan.

Analysis in

DBACockpit

 

How is table accessed, by table scan or index access? What’s the estimated total cost?

 

Run transaction RSRT, enter Query Name “ZSD_C01/BENCHMARK_QUERY_2”, click on “Execute + Debug”, check flags “Do not use cache” and “Display statistics data” (under “Others” section), hit Continue button.

After the query results are displayed press “Back” button in the toolbar of the result win- dow, the runtime statistics of the query is displayed.

win- dow, the runtime statistics of the query is displayed. Question : how much time was

Question: how much time was spent in the database (Data Manager) and how much time was spent in the SAP Application Server (total time spent on all OLAP events)?

4.2

BI Query

Monitor

Write down the Duration of Data Manager to the Work Sheet on the fi- nal page of this hand book.

 

Run transaction RSRT, enter Query Name “ZSD_C01/BENCHMARK_QUERY_2”, click on “Execute + Debug”,

4.3

Check

check flags ““Display SQL/BIA Query” (under “Data Manager” section), hit Continue button.

SQL Trace

and access

 

plan

Firstly you will see the SQL statement display window, review the SQL statement.

DB2 LUW for SAP BW Lab Exercises

From the above SQL statement, you can tell it is selecting data from F fact
From the above SQL statement, you can tell it is selecting data from F fact table joined
with dimension tables for dimension T, U, 13 (sales org) and P where CALMONTH is
between 200001 and 200012 and SALESORG is equal to 83, returning summarized col-
umn INCORDVAL (total incoming order value), INVCD_QTY (total invoiced quantity)
and INVCD_VAL (total invoiced value) that are grouped by sales division and calendar
year/month.
On this window, click on SQL Query Visualizer button
, you will get the Query

DB2 LUW for SAP BW Lab Exercises

Visualization screen. Further click on the “Schema View Block Query Block 0” bar, you will
Visualization screen. Further click on the “Schema View Block Query Block 0” bar, you
will see the graphical view of the query structure. Click on one of the tables, e.g.
/BIC/DZSD_C01T table, you will see the details about this table as well as the table join
with the fact table.
Questions:
1. what are the “local conditions” applied to this table? What selectivity can you
get when applying these conditions on this table?
2. how many number of rows in this table?
3. what’s the estimated number of output rows?
4. what condition is used to join this table with the fact table?
Open another SAP GUI window and activate ST05 SQL trace;
then click on “back” button on the tool bar of SQL screen to complete the query execu-
tion;
deactivate ST05 trace.
Display ST05 SQL Trace, locate the SQL-Statements that correspond to the query in the
RSRT SQL window (obj. name = /BIC/FZSD_C01).
Explain this SQL statements from within the ST05 trace (move the cursor on the state-
ment text first, then click on Explain button)

DB2 LUW for SAP BW Lab Exercises

On the Display Execution Plan for SQL Statement window, you get the access plan. Click
On the Display Execution Plan for SQL Statement window, you get the access plan.
Click on the Tree Info button, you will see the number of rows returned, total cost and
I/O cost of each operation.
Questions:
1. What is the name of the fact table?
2. Which dimension table is joined firstly to the fact table, what type of join?
3. What method is used to access the fact table? If it is an index access, what is the
index being used?
4. What is the total cost of this access plan?
5. How many rows will be returned by this query according to the access plan?
4.4 check
SQL Cache
Another way to check the query access plan, without using ST05 trace, is to check DB2
SQL cache (Package cache) directly.

DB2 LUW for SAP BW Lab Exercises

In another SAP GUI window, go to DBACockpit -> Performance -> SQL Cache. On the
In another SAP GUI window, go to DBACockpit -> Performance -> SQL Cache.
On the Selection Criteria window, remove 100 from the Executions field, and enter the
“SELECT*FZSD_C01*” in the SQL Text field.
The following statement execution result is returned:
Write down the Avg. Execution time, Buffer Quality, Rows Read, SQL
Sorts and the total Estimated Costs to the Work Sheet on the final page
of this hand book.
*Note* For more accurate comparison, especially to demonstrate the disk I/O cost sav-
ing by using MDC feature in the next exercise, you need to run the query in a “cold”
buffer pool, which means the table data should not have been cached in the buffer pool.
This will require comparing the result on the first query execution on a newly started
system. Therefore you might want to stop and restart your SAP system before running the
query.
Double click on the statement, or click on Explain button, you will get the access plan of
this statement.
In the case of query performance problem, and you want to open an SAP OSS message,
you need to collect related diagnostics data for this query.
On the Display Execution Plan screen, click on Collect button, which will allow you to
download query related data, such as database configuration parameters, table and index
definitions and statistics, detailed access plan, etc. into respective files.
4.5 Collect
diagnostics
data for
query per-
formance
problem

DB2 LUW for SAP BW Lab Exercises

For deeper analysis, you can use db2support tool to collect much more detailed data, which
For deeper analysis, you can use db2support tool to collect much more detailed data,
which will allow IBM DB2 support to mimic your runtime environment and reproduce
the problem on their test system.
Steps:
1.
Save SQL statement in a text file. From the Execution Plan screen, you can
click on Edit button, which will open a Edit SQL Statement window, you could
use one of the following ways to create a statement text file on the database :
a. select the entire statement text, hit CTRL+C to copy the text to the
clipboard, then on the DB2 command window (in user db2n4s) on the
database server, use vi editor to create a file query2.sql, paste the
statement text to vi, add an “;” at the end of the statement, and save this
file;
b. you can save the file locally by using the Save as local file button.
Then move the file from local to the database server in a directory that
can be accessed by user db2n4s (e.g. /db2/N4S/db2dump). You also
need to edit the file by adding “;” at the end.
4.6 use
db2support
tool to col-
lect detailed
query per-
formance
data
2.
On the database server, in the db2n4s command window, enter the following
command:
n4shost:db2n4s 176> db2support /db2/N4S/db2dump –d n4s -sf query2.sql -
curschema sapn4s
Once the db2support.zip file is generated, download it to the local server, and check what
data has been collected.

DB2 LUW for SAP BW Lab Exercises

Or use the following command to unzip the file on the server: n4shost:db2n4s 193> unzip
Or use the following command to unzip the file on the server: n4shost:db2n4s 193> unzip

Or use the following command to unzip the file on the server:

n4shost:db2n4s 193> unzip db2support.zip

DB2 LUW for SAP BW Lab Exercises

Unit 5 – MDC for SAP BW

 

Run transaction RSA1: Modelling InfoProvider Select “benchmark” Right- click InfoCube “Benchmarkcube” “Additional Functions” Reclustering

5.1

Click button “Initialize”

Click button “Initialize”

Change/defin e MDC set- tings for an existing In- foCube

 

The system is asking if a database backup was done. You must answer the pop-up with “Yes.” Otherwise, you cannot activate the changes. Reclustering entails copying data from the original table into a shadow MDC table. Therefore a valid backup before the

5.2

Confirm

changes is required. In this exercise, we will skip the database backup.

that a recent backup was done before activating the changes

that a recent backup was done before activating the changes
 

Select “Multi-Dimensional Clustering” Confirm selection

Select “Multi-Dimensional Clustering” Confirm selection

5.3

Select

clustering

type

DB2 LUW for SAP BW Lab Exercises

5.4

Select the

The default setting for the number of MDC columns is 3. If you select more than three columns (excluding “Package Dimension”), the system displays an error pop-up. Choosing too many columns will probably result in many half empty MDC cells allo-

correct num- ber of MDC

columns

cated.

 

By default, the time dimension SID_0CALMONTH is automatically selected as the first MDC dimension. Check “Package Dimension on F Fact Table”. A dimension on Package number will help to improve BW compression function. Also enter 2 on line “ZSD_C013 Sales Area” to define it as the second MDC dimen- sion. Check “Execute Space Check”.

second MDC dimen- sion. Check “Execute Space Check”. Click “Continue” button, and receive the following

Click “Continue” button, and receive the following space check result:

5.5

Choose

MDC

dimen-

sion columns

among Info-

Cube

dimen-

sion col-

umns,

and

define the

sequence

number of

MDC

dimen-

sion

DB2 LUW for SAP BW Lab Exercises

The Space Check result is displayed in red colour, which means over 50% (Number of
The Space Check result is displayed in red colour, which means over 50% (Number of
free pages 159180 / Number of pages that can be allocated 318360) of table space will
be wasted. Further looking at the result, you see that the “Number of different values in
MDC
dimension KEY_ZSD_C013” (Sales Area) is 64203, which is too great, com-
pared
to the other two MDC dimension columns on Package Dimension (12) and
CALMONTH (132). Therefore “Sales Area” is not a good candidate for MDC dimen-
sion, and we need to remove the second MDC dimension on “Sales Area”.
Click
on “Cancel” button, go back to previous MDC definition screen, remove “2”
from the line “Sales Area”, and leave Package Dimension and Calendar Month as MDC
dimension columns. Click “Continue” button again, and display the new space check
result:

DB2 LUW for SAP BW Lab Exercises

 

This time the space check result is displayed in green colour, because the potential wasted space is less than 30% (Number of free pages 55 / Number of pages that can be allocated 1848 = 2.9%)

Click “Continue” button.

 

New request created confirmation. Click on “Continue” button.

New request created confirmation. Click on “Continue” button.

5.6

Confirm

request

 

Start re-cluster job in background. Select “Immediate” options for the background job, then click “Save” icon.

Going back to Reclustering of InfoProviders screen, click on “Monitor” button. On the Monitor Requests screen, click on Refresh button until you see the status becomes green.

click on Refresh button until you see the status becomes green. You can also use SM37

You can also use SM37 to check the background job status.

5.7

Schedule

re-cluster job

in batch

 

Run transaction SE14. Enter table name: /BIC/FZSD_C01 Edit

5.8

Check

To check the table structure use button “Storage Parameter.” The clause “Organize by Dimensions” is used to define a MDC dimension. In this case, two MDC dimensions are defined: “KEY_ZSD_C01P” and “SID_0CALMONTH”.

storage pa-

rameter

DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises Run transaction DBACockpit, go to Space Single Table Analysis,

Run transaction DBACockpit, go to Space Single Table Analysis, enter table name “/BIC/FZSD_C01” and hit Enter.

5.9 Fact Ta- ble Analysis

and hit Enter. 5.9 Fact Ta- ble Analysis Write down the Total Table Size, To tal

Write down the Total Table Size, Total Index Size and No. of Pages with Data to the Work Sheet on the final page of this hand book.

Comparison of the table size before and after the table is converted to MDC.

You should notice that the total table size has increased, and in the mean time, the total index size has decreased because of using block index.

Also check the “Index Structures”, in which you should find

DB2 LUW for SAP BW Lab Exercises

 

1. A composite Block Index “SQL080104193459110” has been defined on both columns “KEY_ZSD_C01P” and “SID_0CALMONTH”.

2. A dimension Block Index “SQL080104193459220” has been defined on col- umn “SID_0CALMONTH”.

3. A dimension Block Index “SQL080104193459240” has been defined on col- umn “KEY_ZSD_C01P”.

All MDC block indexes are generated by the system and therefore start with SQL<number>. The index name generated on your system might differ.

All regular RID indexes are user defined and follow the SAP naming convention for indexes:

<Table Name>~<INDEX-NUMBER>, e.g. /BIC/FZSD_C01~020.

 

Run transaction RSRT, enter Query Name “ZSD_C01/BENCHMARK_QUERY_2”, click on “Execute + Debug”, check flags “Do not use cache” and “Display statistics data” (under “Others” section), hit Continue button.

After the query results are displayed press “Back” button in the toolbar of the result window, the runtime statistics of the query is displayed.

5.10

Run BI

Question : how much time is spent in the database (Data Manager) this time?

Question: how much time is spent in the database (Data Manager) this time?

query again and verify the performance improvement after the fact table is con- verted to MDC. Com- paring the result to 4.2

Write down the Duration of Data Manager to the Work Sheet on the final page of this hand book.

5.11

Check

In another SAP GUI window, go to DBACockpit -> Performance -> SQL Cache. On the Selection Criteria window, remove 100 from the Execution field, and enter the “SELECT*FZSD_C01*” in the SQL Text field.

query per-

The following statement execution result is returned:

formance and

access plan

access plan

DB2 LUW for SAP BW Lab Exercises

Double click on the statement, or click on the Explain button, you can get the
Double click on the statement, or click on the Explain button, you can get the following
access plan:
Ques-
tions:
1.
What method is used to access the fact table? If it is an index access, what is
the index being used? Hint – now it is using MDC block index based on
CALMONTH dimension column.
2.
Which dimension table is joined firstly to the fact table, what type of join?
3.
What is the total cost of this access plan? Compared this cost with the result
from the exercise 4.3.
Write down the Avg. Execution time, Buffer Quality, Rows Read, SQL
Sorts and the total Estimated Costs to the Work Sheet on the final page
of this hand book.
*Note* For more accurate comparison, especially to demonstrate the disk I/O cost sav-
ing by using MDC feature, you need to run the query in a “cold” buffer pool, which
means the table data should not have been cached in the buffer pool. This will require
comparing the result on the first query run on a newly started system. Therefore you
might want to stop and restart your SAP system before running the query.
As you can tell, the query time is much faster after the fact table has been converted to
MDC table. And the access plan indicates that the block index defined on

DB2 LUW for SAP BW Lab Exercises

 

SID_0CALMONTH is used to select rows on the fact table.

 

Run program “SAP_RSADMIN_MAINTAIN” in transaction SA38. Enter DB6_MDC_FOR_PSA in the OBJECT field, and YES in the VALUE field, choose INSERT, then click on Execute button.

SA38. Enter DB6_MDC_FOR_PSA in the OBJECT field, and YES in the VALUE field, choose INSERT, then

5.12

Change

settings in

table

RSADMIN.

 

Run transaction SE16 - Data Browser Browse table: RSADMIN Restrict values in field “OBJECT” to “DB6*”

RSADMIN Restrict values in field “OBJECT” to “DB6*” Entries starting with DB6 are DB2 for LUW

Entries starting with DB6 are DB2 for LUW related. The following entries control MDC settings:

5.13

Check

settings in

table

RSADMIN.

•1

DB6_MDC_FOR_PSA = YES/NO default NO DB6_MDC_FOR_AGGREGATES = YES/NO default YES

•2

DB2 LUW for SAP BW Lab Exercises

Unit 6 – Deep Compression for SAP BW

 

Run transaction RSRV:

On the “Analysis and Repair of BI Objects” screen, expand “Tests in Transaction RSRV” “All Elemetary Tests” “Database” Double-click “Data row compres- sion of InfoProviders…”. to select the test. Double click on the row in the right side of the screen. A pop-up will appear.

of InfoProviders…”. to select the test. Double click on the row in the right side of

6.1

Check the

Compression

Details for

InfoCube

 

Select the InfoProvider you want to test “ZSD_C01” and click “Transfer.”

6.2

Select the

6.2 Select the

InfoProvider you want to check

6.3

Execute

Expand the row in the right side of the screen, high light the line “Info- Provider=ZSD_C01”, execute the test by pressing button “Execute.”

the test

DB2 LUW for SAP BW Lab Exercises

 
 
 

The result shows the compression feature is NOT enabled for the F fact and E fact ta- bles of InfoCube ZSA_C01, and the F fact table size is 32.78MB.

feature is NOT enabled for the F fact and E fact ta- bles of InfoCube ZSA_C01,

6.4

Check the

result

 

Run transaction DBACockpit, go to Space Single Table Analysis, enter table name “/BIC/FZSD_C01” and hit Enter.

6.5

Estimate

Compression

Select the tab “Compression Status”. It shows that this fact table is not enabled for compression.

Ratio

DB2 LUW for SAP BW Lab Exercises

Click “Compression Check” button, on the following screen, click on “Execute” but- ton. Note: since
Click “Compression Check” button, on the following screen, click on “Execute” but-
ton.
Note: since this is a small table, it is OK to choose “Run in Dialog”. If it is a large ta-
ble, it is better to run in a background job.
When it finishes, click on “Refresh” button, and the compression check result is
shown:
It is estimated that 66% of pages will be saved.

DB2 LUW for SAP BW Lab Exercises

Click on “Compression On/Off” button, on the following screen, choose “Enable Compression and Run REORG”,
Click on “Compression On/Off” button, on the following screen, choose “Enable
Compression and Run REORG”, click “Execute” button.
6.6 Enable
Compression
On the Schedule a New Action screen, click on “Execute Immediately” button.

DB2 LUW for SAP BW Lab Exercises

 

You can use transaction SM37 to check the Reorg job status. Once it is completed, refresh the Single Table Analysis screen. And you will see that it is compressed with 66% pages saved.

And you will see that it is compressed with 66% pages saved. 6.7 Check the compression

6.7 Check the

compression result

Flip to the tab “Table”, you will see the new table size is now 12864K.

“Table”, you will see the new table size is now 12864K. Write down the Total Table

Write down the Total Table Size, Total Index Size and No. of Pages with Data to the Work Sheet on the final page of this hand book.

You should notice that the table size and the No. of Pages with Data have decreased significantly.

DB2 LUW for SAP BW Lab Exercises

 

Run transaction RSRT, enter Query Name “ZSD_C01/BENCHMARK_QUERY_2”, click on “Execute + Debug”, check flags “Do not use cache” and “Display statistics data” (under “Others” section), hit Continue button.

After the query results are displayed press “Back” button in the toolbar of the result window, the runtime statistics of the query is displayed.

6.8

Run BI

Question : how much time is spent in the database (Data Manager) this time?

Question: how much time is spent in the database (Data Manager) this time?

query again and verify the performance improvement after the fact table is con- verted to MDC. Com- paring the result to 4.2

Write down the Duration of Data Manager to the Work Sheet on the final page of this hand book.

 

In another SAP GUI window, go to DBACockpit -> Performance -> SQL Cache. On the Selection Criteria window, remove 100 from the Execution field, and enter the “SELECT*FZSD_C01*” in the SQL Text field.

The following statement execution result is returned:

field. The following statement execution result is returned: 6.9 Check query per- Double click on the

6.9

Check

query per-

Double click on the statement, or click on the Explain button, you can get the access plan. Compare this access plan with the access plan you saw in exercise 5.11. They

formance and

access plan

should be the same, except that the total estimated costs are different because of disk I/O cost saving on the compressed fact table.

Write down the Avg. Execution time, Buffer Quality, Rows Read, SQL Sorts and the total Estimated Costs to the Work Sheet on the final page of this hand book.

*Note* For more accurate comparison, especially to demonstrate the disk I/O cost saving by using MDC feature or compression feature, you need to run the query in a “cold” buffer pool, which means the table data should not have been cached in the buffer pool. This will require comparing the result on the first query run on a newly

DB2 LUW for SAP BW Lab Exercises

 

started system. Therefore you might want to stop and restart your SAP system before running the query.

As you can tell, the query time should be faster after the fact table has been com- pressed because of the savings on the disk I/O.

 

Run program “SAP_RSADMIN_MAINTAIN” in transaction SA38. Enter DB6_ROW_COMPRESSION in the OBJECT field, and YES in the VALUE field, choose INSERT, then click on Execute button.

6.10

6.10

Change set- tings in ta- ble RSAD- MIN.

 

Run transaction SE16 - Data Browser Browse table: RSADMIN Restrict values in field “OBJECT” to “DB6*”. You will see now DB6_ROW_COMPRESSION is set to YES.

6.11 Check

6.11 Check

settings in

table

RSAD-

MIN.

DB2 LUW for SAP BW Lab Exercises

Unit 7 – BI Operations

Before starting the BI compression, let’s check the total number of records in F fact table and E fact table of InfoCube ZSD_C01. How to do that? Hint – use DBACockpit Single Table Analysis function.

Results: F fact should contain 160600 records, and E fact table contains 0 records.

Now move to DW Workbench screen.

Let’s check how many records was loaded in the request 14.

Run transaction RSA1 Modeling InfoProvider Select “benchmark” Select “Benchmarkcube” and right-click Select “Manage” Select “Requests” tab.

Click on the Monitor icon on the line of request 14. You should see the
Click on the Monitor icon on the line of request 14. You should see the detailed informa-
tion of request 14.

Click on Details tab, and expand Extraction and Transfer menu:

You can see that there are 13640 records being extracted from the source file. Data was loaded in the package size of 1000. There were 14 data packages were created and loaded in BW.

7.1 Com-

press an

InfoCube

DB2 LUW for SAP BW Lab Exercises

Now go back to InfoProvider Administration screen, click on tab Collapse.

Now go back to InfoProvider Administration screen, click on tab Collapse.

Now go back to InfoProvider Administration screen, click on tab Collapse.

DB2 LUW for SAP BW Lab Exercises

Enter the Job Name BI_COMPZSD_C01_REQ14, and Rquest ID “14”. Before releasing the compression job, let’s
Enter the Job Name BI_COMPZSD_C01_REQ14, and Rquest ID “14”.
Before releasing the compression job, let’s turn on ST05 SQL trace.
Now click on Release button and it will schedule a background job. Click on the button
Log to monitor the job status.
When the job is finished, go back to Requests tab, and click on Refresh button, you should
see a check mark in the third column (Compression Status in InfoCube) on the line of Re-
quest 14.

DB2 LUW for SAP BW Lab Exercises

Go to the DBACockpit Single Table Analysis, Enter table name /BIC/FZSD_C01, do a RUNSTATS in
Go to the DBACockpit Single Table Analysis, Enter table name /BIC/FZSD_C01, do a
RUNSTATS in dialog. When the runstats finishes, you should see the table cardinality is
changed from 160.600 to 146.960, which means 13640 records has been deleted in F fact
table.
Now check table /BIC/EZSD_C01. You should see its cardinality is 13640, which means
13640 records has been inserted into E fact table.
Go to the ST05 screen and deactivate the trace. Display the trace. You should be able to
find the following statements in the Trace List screen:
The above INSERT and DELETE statements are key statements to this InfoCube
compression process.
Move the cursor to the INSERT statement, and click on Explain button. You will
see the full statement text and the access plan:

DB2 LUW for SAP BW Lab Exercises

Try to understand this SQL statement. This is a INSERT…SELECT statement. It basically select records from F fact table based on the request ID and insert these records into E fact table.

Question: what index is used to select records from F fact table? Answer: a MDC block index on Package dimension. Shown below:

: a MDC block index on Package dimension. Shown below: Go back to Trace List screen,

Go back to Trace List screen, move the cursor to the DELETE statement, and click on Explain button. You will see the full statement text and the access plan:

button. You will see the fu ll statement text and the access plan: Do you understand

Do you understand what this DELETE statement does?

DB2 LUW for SAP BW Lab Exercises

 

Now that we have some data being compressed into E fact table, we have InfoCube data stored in both F and E fact tables. How will this affect the query?

Run transaction RSRT, enter Query Name “ZSD_C01/BENCHMARK_QUERY_2”, click on “Execute + Debug”,

7.2

Run

check flags ““Display SQL/BIA Query” (under “Data Manager” section), hit Continue button.

the BI

query

Firstly you will see the first SELECT statement that selects from F fact table; click on the Back button, you will see the second SELECT statement that selects from E fact table; click on the Back button again, you will get the query result.

Therefore the query result is a merged result from two separate queries, one from F fact table, and the other from E fact table.

 

Run program “SAP_RSADMIN_MAINTAIN” in transaction SA38. Enter DB6_MDC_FOR_AGGREGATES in the OBJECT field, and YES in the VALUE field, choose INSERT, then click on Execute button.

VALUE field, choose INSERT, then click on Execute button. After this, you can run SE16 to

After this, you can run SE16 to display this parameter in table RSADMIN.

7.3

Enable

MDC for

aggregates

7.4

Create

 

an aggre-

On the InfoProvider Administration screen of ZSD_C01, click on Rollup tab.

gate

DB2 LUW for SAP BW Lab Exercises

Click on Aggregates button to maintain aggregates of this InfoCube. On the following screen, click

Click on Aggregates button to maintain aggregates of this InfoCube.

On the following screen, click on Create by Yourself button.

On the following screen, click on Create by Yourself button. On the Maintenance for Aggregate screen,

On the Maintenance for Aggregate screen, Click on the Create New Aggregate button. Enter the aggregate description as below:

Aggregate button. Enter the aggregate description as below: and hit Enter. Drag Sales Area dimension and

and hit Enter. Drag Sales Area dimension and Time dimension from the left window onto the newly cre-

DB2 LUW for SAP BW Lab Exercises

ated aggregate ZSD_C01_SALES_TIME on the right window, as below: Click on the Save button at
ated aggregate ZSD_C01_SALES_TIME on the right window, as below:
Click on the Save button at the top of the window to save the aggregate definition. Then
click on the Activate and Fill button.
Click on Start button, and choose Immediately on the pop-up message box:
Click on the Jobs button and you will be directed to the Job Overview screen. On the Job

DB2 LUW for SAP BW Lab Exercises

Overview screen, when the job BI_SAGR* job is completed, click on the Job Log button,
Overview screen, when the job BI_SAGR* job is completed, click on the Job Log button,
you will see the following job logs. From this job log, you can tell how the aggregate is
filled:

DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises WW DB2 SAP Technical Enablement and Support Team P

DB2 LUW for SAP BW Lab Exercises

Use DBACockpit -> Space -> Single Table Analysis to check the table and index structure
Use DBACockpit -> Space -> Single Table Analysis to check the table and index structure
and statistics of aggregate F table /BIC/F100004 and /BIC/F100004.
You should see that the aggregate fact table inherit the MDC definition of the InfoCube
fact table. Therefore the aggregate fact table also has package and calmonth defined as
MDC
dimension.
7.5
Check
aggregate
fact tables
Since
now we have the aggregate defined on both SALES AREA and TIME dimension,
the original query we have run should select data from the aggregate rather than from the
infocube. We can verify this by running the query again.
Run transaction RSRT, enter Query Name “ZSD_C01/BENCHMARK_QUERY_2”,
click on “Execute + Debug”,
7.6
Run BI
query
check
flags ““Display SQL/BIA Query” (under “Data Manager” section), hit Continue
again
button.
Now you will see the SELECT statement that selects from the aggregate E fact table
/BIC/E100004.
click on the Back button then this query will be executed and the query result will be dis-
played.

DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises WW DB2 SAP Technical Enablement and Support Team P

DB2 LUW for SAP BW Lab Exercises

Fact table Size Com- parison Query Per- formance Comparison Work Sheet   Default table (no

Fact table

Size Com-

parison

Query Per-

formance

Comparison

Work Sheet

Com- parison Query Per- formance Comparison Work Sheet   Default table (no Default table (no MDC)
 

Default table (no

Default table (no

MDC)

MDC)

MDC

MDC

table

table

Compressed

Compressed

MDC

MDC

table

table

Total Table size

Total Table size

     

Total Index size

Total Index size

     

No. of Pages

No. of Pages

     

with Data

with Data

 

Default table (no

Default table (no

MDC)

MDC)

MDC

MDC

table

table

Compressed

Compressed

MDC

MDC

table

table

RSRT Data Man-

RSRT Data Man-

     

ager Duration

ager Duration

Avg. Execution

Avg. Execution

     

Time (ms)

Time (ms)

Rows Read

Rows Read

     

Buffer Quality

Buffer Quality

     

SQL Sorts

SQL Sorts

     

Access Plan Es-

Access Plan Es-

     

timated Costs

timated Costs

(timerons)

(timerons)