+ All Categories
Home > Documents > DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

Date post: 14-Apr-2015
Category:
Upload: ji-yong-jung
View: 239 times
Download: 13 times
Share this document with a friend
Description:
DB2 LUW for SAP BW Lab Exercises
56
DB2 LUW for SAP BW Lab Exercises WW DB2 SAP Technical Enablement and Support Team Page 1 DB2 LUW for SAP BW Lab Exercise Hand Book WW DB2 SAP TECHNICAL ENABLEMENT AND SUPPORT TEAM
Transcript
Page 1: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 1

DB2 LUW for SAP BW

Lab Exercise Hand Book

WW DB2 SAP TECHNICAL ENABLEMENT AND SUPPORT TEAM

Page 2: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 2

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

Page 3: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 3

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

Page 4: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 4

Unit 1 – DB2 LUW Administration in General

1.1 Logon data

System ID : N4S Database server : n4shost System number : 42 User ID : bwuser Password : sapn4sadm

1.2 Understand DB2 database Key Per-formance Indicators (KPIs)

Run transaction DBACockpit (or ST04), and found out the following KPIs: 1. buffer pool quality on database level and on each table space level? 2. package cache and catalog cache quality, any cache overflow? 3. any lock escalation and dead locks? 4. any sort overflow?

1.3 Understand DB2 configuration

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

1.4 Get familiar with “Single Table Analysis” feature

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

1. what’s the table size? How many rows (cardinality)? 2. when was the last time the table statistics was collected? 3. how many indexes have been defined? 4. check table structure, index structure

1.5 Buffer Pool and Table space mainte-nance

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. Add a table space “myspace” from DBACockpit, with automatic stor-age feature, 32K page size and assign BP32K to it

3. 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.6 Use db2look tool

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

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

Page 5: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 5

Unit 2 – BI Objects in DB2

2.1 System overview

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.

2.2 Find the database table name for a InfoCube

Run transaction RSA1 Modeling InfoProvider Select “benchmark” Select “Benchmarkcube” and right-click Select “Manage” Select “Contents” tab Select button “Fact Table” Table name is shown in header line.

2.3 Check Fact table storage pa-rameters

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

(DDIC) and physical database table.

Page 6: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 6

2.4 Check storage pa-rameter

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.

Page 7: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 7

2.5 Schema Viewer for InfoCubes

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.6 Fact table analysis

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

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.

Page 8: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 8

2.7 Find the database table name for a DataStore Object

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

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

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

2.8 Check ODS table storage pa-rameters

In SE14, enter table name /BIC/AODSBENCH40, /BIC/AODSBENCH00, and /BIC/B0000002000 Find out their partitioning keys, indexes, etc.

2.9 Check ODS table structure

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

2.10 Find the database table name for a PSA table

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.

One record is found:

Page 9: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 9

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

2.11 Check PSA table storage pa-rameters

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

2.12 Check PSA table structure

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

2.13 Find the InfoObject and Master Data Tables

Run transaction RSA1 Modeling InfoObjects Unassigned Nodes Unas-signed Characteristics Search for “Customer Number” and double click. What master data tables have been created for InfoObject 0CUSTOMER? Write down the SID table name, and other master table names. Use SE14 and Single Table Analysis to check each table. You can also use SE16 to display table contents.

Page 10: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 10

Unit 3 – Scaling out SAP BW database

3.1 Create a new da-tabase partition group 3.2 Create new table spaces

3.3 Create a new data class

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:

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.

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

Page 11: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 11

3.4 Create a new In-foArea 3.5 Create a new In-foCube by copying the existing Info-Cube ZSD_C01

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

Right click on the “My InfoArea”, and select “Create InfoCube”. 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.

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

Page 12: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 12

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

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

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

Page 13: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 13

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

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.

3.7 Create Trans-formation

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.

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.

Page 14: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 14

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.

Page 15: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 15

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.

Page 16: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 16

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*”. )

3.10 Create a Data Transfer Process (DTP)

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.

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

3.11 Load data to the InfoCube ZSD_C02

On the “Display Data Transfer Process” screen, choose “Execute” tab, and click on Execute in the Background button, Click Yes to the question “Do you want to display the request monitor?”. On the Data Transfer Process monitor screen, click Refresh button to check job status until the job is completed.

3.12 Check ZSD_C02 Fact table

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.

3.13 Add a new par-tition

Before adding a partition, check the current partition configuration:

Page 17: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 17

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

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

Page 18: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 18

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.

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

Page 19: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 19

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 0 0 SQL1064N DB2STOP processing was

successful.

01/27/2009 13:18:45 1 0 SQL1064N DB2STOP processing was

successful.

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.

Page 20: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 20

3.14 Check current F fact table data distri-bution

Firstly, let’s check the current data distribution of the fact table /BIC/FZSD_C02. 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.

3.15 Redistribute the existing table data to the new partition

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. Check Start Immediately, and then click continue. 4. Review the redistribution procedure summary and then click execute to

start the redistribution process. 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.

3.16 Check new F fact table data distri-bution

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-num(key_zsd_c02p) 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.

Page 21: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 21

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.

3.18 Redistribute the data back across the remaining partitions in the partition group

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. check Start Immediate, and then click continue one last time.

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.

3.19 Remove the partition from the database manager

Dropping the partition from the database manager cannot be done from within SAP. Once the preceding redistribute finishes, logon to n4shost as db2n4s, and run the following command to verify which partitions are still in use by the da-tabase: 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 partition removal and data distribu-tion, and restart sap

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

Page 22: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 22

Unit 4 – BI Query Analysis

4.1 Query Analysis in DBACockpit

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. How is table accessed, by table scan or index access? What’s the estimated total cost?

4.2 BI Query Monitor

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.

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)? Write down the Duration of Data Manager to the Work Sheet on the fi-nal page of this hand book.

4.3 Check SQL Trace and access plan

Run transaction RSRT, enter Query Name “ZSD_C01/BENCHMARK_QUERY_2”, click on “Execute + Debug”, check flags ““Display SQL/BIA Query” (under “Data Manager” section), hit Continue button. Firstly you will see the SQL statement display window, review the SQL statement.

Page 23: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 23

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

Page 24: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 24

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)

Page 25: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 25

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.

Page 26: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 26

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.

4.5 Collect diagnostics data for query per-formance problem

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.

Page 27: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 27

4.6 use db2support tool to col-lect detailed query per-formance data

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.

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.

Page 28: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 28

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

Page 29: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 29

Unit 5 – MDC for SAP BW

5.1 Change/define MDC set-tings for an existing In-foCube

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

Click button “Initialize”

5.2 Confirm that a recent backup was done before activating the changes

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 changes is required. In this exercise, we will skip the database backup.

5.3 Select clustering type

Select “Multi-Dimensional Clustering” Confirm selection

Page 30: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 30

5.4 Select the correct num-ber of MDC columns

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

5.5 Choose MDC dimen-sion columns among Info-Cube dimen-sion col-umns, and define the sequence number of MDC dimen-sion

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

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

Page 31: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 31

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:

Page 32: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 32

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.

5.6 Confirm request

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

5.7 Schedule re-cluster job in batch

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.

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

5.8 Check storage pa-rameter

Run transaction SE14. Enter table name: /BIC/FZSD_C01 Edit 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”.

Page 33: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 33

5.9 Fact Ta-ble Analysis

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

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

Page 34: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 34

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.

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

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.

Question: how much time is spent in the database (Data Manager) this time? Write down the Duration of Data Manager to the Work Sheet on the final page of this hand book.

5.11 Check query per-formance and access plan

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:

Page 35: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 35

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

Page 36: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 36

SID_0CALMONTH is used to select rows on the fact table.

5.12 Change settings in table RSADMIN.

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.

5.13 Check settings in table RSADMIN.

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

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

•1 DB6_MDC_FOR_PSA = YES/NO default NO •2 DB6_MDC_FOR_AGGREGATES = YES/NO default YES

Page 37: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 37

Unit 6 – Deep Compression for SAP BW

6.1 Check the Compression Details for InfoCube

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.

6.2 Select the InfoProvider you want to check

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

6.3 Execute the test

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

Page 38: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 38

6.4 Check the result

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.

6.5 Estimate Compression Ratio

Run transaction DBACockpit, go to Space Single Table Analysis, enter table name “/BIC/FZSD_C01” and hit Enter. Select the tab “Compression Status”. It shows that this fact table is not enabled for compression.

Page 39: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 39

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.

Page 40: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 40

6.6 Enable Compression

Click on “Compression On/Off” button, on the following screen, choose “Enable Compression and Run REORG”, click “Execute” button.

On the Schedule a New Action screen, click on “Execute Immediately” button.

Page 41: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 41

6.7 Check the compression result

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.

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

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.

Page 42: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 42

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

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.

Question: how much time is spent in the database (Data Manager) this time? Write down the Duration of Data Manager to the Work Sheet on the final page of this hand book.

6.9 Check query per-formance and access plan

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:

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

Page 43: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 43

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.

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

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.11 Check settings in table 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.

Page 44: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 44

Unit 7 – BI Operations

7.1 Com-press an InfoCube

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

Page 45: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 45

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

Page 46: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 46

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.

Page 47: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 47

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:

Page 48: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 48

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:

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:

Do you understand what this DELETE statement does?

Page 49: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 49

7.2 Run the BI query

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”, check flags ““Display SQL/BIA Query” (under “Data Manager” section), hit Continue button. 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.

7.3 Enable MDC for aggregates

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.

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

7.4 Create an aggre-gate

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

Page 50: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 50

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

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

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

Page 51: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 51

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

Page 52: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 52

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:

Page 53: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 53

Page 54: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 54

7.5 Check aggregate fact tables

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.6 Run BI query again

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”, check flags ““Display SQL/BIA Query” (under “Data Manager” section), hit Continue 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.

Page 55: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 55

Page 56: DB2 LUW for SAP BW Lab Exercises

DB2 LUW for SAP BW Lab Exercises

WW DB2 SAP Technical Enablement and Support Team Page 56

Work Sheet

Fact table Size Com-parison

Query Per-formance Comparison

Default table (no MDC)

MDC table Compressed MDC table

Total Table size

Total Index size

No. of Pages with Data

Default table (no MDC)

MDC table Compressed MDC table

Total Table size

Total Index size

No. of Pages with Data

Default table (no MDC)

MDC table

Compressed MDC table

RSRT Data Man-ager Duration

Avg. Execution Time (ms)

Rows Read

Buffer Quality

SQL Sorts

Access Plan Es-timated Costs (timerons)

Default table (no MDC)

MDC table

Compressed MDC table

RSRT Data Man-ager Duration

Avg. Execution Time (ms)

Rows Read

Buffer Quality

SQL Sorts

Access Plan Es-timated Costs (timerons)


Recommended