Note 129252 - Oracle DB Statistics for BW Tables

Summary
Symptom
You want to create DB statistics on a BW-system or an APO or SEM system with an underlying (local) BW. The respective BW runs on an Oracle database platform.
Other terms
OLAP, Business Information Warehouse, InfoCube, Report, Query, Performance, Oracle, Cost-Based Optimizer, Statistics, DB statistics
Reason and Prerequisites
The BW query performance relies on Oracle's cost based optimizer choosing (near-) optimal execution plans. To that end, the cost-based optimizer requires statistical information on content of the tables that are involved in a query. If no such information exists or if it is out-dated then this might cause performance problems. Furthermore Oracle's cost-based optimizer works best for BW if it can rely on statistics with histograms, respectively statistics for columns.
SAPDBA, as a frequently used tool, had problems to create such statistics for various reasons: it lacked the ability to create statistics with histograms and it could not cope with partitioned tables. SAPDBA has been taken out of maintenance.
With SAP base release 6.10, BRCONNECT has taken over SAPDBA's statistics gathering functions. For details see http://service.sap.com/dbaora.
The following section describes the proposed way to gather statistics for the various releases of BW. This refers to the regular process for gathering those statistics. Independently, BW might still analyse tables in appropriate situations such as after data has been loaded, during an aggregates roll-up or a change run. These BW-triggered statistics runs can be switched off. See OSS note 555030 for details.
Solution
  • BW 2.x, BW 3.0A systems
           We recommend to run the report SAP_ANALYZE_ALL_INFOCUBES once per week as a batch job, e.g. at night (see transaction SE38, menu "Program" -> "Execute" -> "Background"). It can run before or after SAPDBA if you use SAPDBA version 4.6D or higher. You should also avoid to run SAP_ANALYZE_ALL_INFOCUBES during data uploads.
           Depending on the sizes of your infocubes the report might run between a few minutes and several hours. Using a 100% sample size, an infocube with a 20-million-rows fact table takes around 2 hours to be analyzed (depending also on your hardware)!
           We suggest that you schedule a weekly job with the report and an initial sample size of 10%. The resulting run time of the job will give you an idea whether you can increase the sample size. This obviously depends also on the time you want to allow the job to run.
           Due to the nature of block-sampling, sample sizes beyond 20% should result in analysis times that are as long as doing a complete analysis (100%). Therefore, we recommend sample sizes of 100% rather than than sizes like 25%, 30%, 40%, ...
           Unfortunately, there is no general (or easy) rule to predict the run time of the report. Therefore we recommend that you experiment in the way described above. In any case, running the report cannot damage anything but increases the BW query performance.
  • BW 3.0B and higher
           We recommend to use BRCONNECT (release 6. 20 or higher) for gathering all DB statistics for BW tables. The proposed way to call BRCONNECT is
                    brconnect -u / -c -f stats -t all
           If your BW system had been upgraded from a BW 2.x or BW 3. 0A system then you have to run the report SAP_DBSTATC_CLEANUP once. This report will clean up the table DBSTATC which was used in the earlier releases to separate the tables that had to be analysed by SAPDBA from those that had to be analysed by the report SAP_ANALYZE_ALL_INFOCUBES. Alternatively, you can initialize the table DBSTATC as described in OSS note 403704. If DBSTATC is not cleaned up then BRCONNECT might not gather all necessary statistics!
  • Remark
           Previously, many customers used the following two calls of BRCONNECT to gather statistics in any of the above BW releases:
                    brconnect -u / -c -f stats -t all -e all_part,info_cubes
                    brconnect-u / -c -f stats -t all_part,info_cubes -f allsel
The first call deals with non-infocube related tables, the second one with infocube related tables, thereby discarding DBSTATC entries. Because this is not the officially supported strategy we recommend to use the aproach described above.
Header Data
Release Status:Released for Customer
Released on:06.08.2003  15:39:45
Master Language:English
Priority:Recommendations/additional info
Category:Performance
Primary Component:BW-SYS-DB-ORA BW ORACLE
Secondary Components:SCM-APO-FCS Demand Planning
BW-SYS-DB BW Database Platforms
Affected Releases
Software
Component
Release
From
Release
To
Release
And
subsequent
SAP_BW
12
12B
12B
X
SAP_BW
20
20A
20B
X
SAP_BW
21
21C
21C
X
SAP_BW
30
30A
30B
X
SAP_BW
310
310
310
X
SAP_BW
40
400
400
X
Correction delivered in Support Package
Support
Packages
Release
Package
Name
SAP_BW
12B
SAP_BW
20A
SAP_BW
20B
SAP_BW
30B
Related Notes

 
1681396 - Query Performance
 
1013912 - FAQ: Oracle BW performance
 
797629 - FAQ: Oracle histograms
 
588668 - FAQ: Database statistics
 
555030 - Deactivating BW-initiated DB statistics
 
524341 - Updating the statistics for individual partitions
 
428212 - Using BRCONNECT to update InfoCube statistics
 
421795 - Report SAP_ANALYZE_ALL_INFOCUBES
 
403704 - BRCONNECT - Enhanced function for Oracle DBA
 
393655 - DP 3.0: Administer performance
 
370601 - Composite SAP note: APO 3.0 and 3.1 performance
 
364305 - ORA-1405:fetched column value is null
 
363092 - Demand Planning: Performance Mass Processing
 
351163 - Creating ORACLE DB statistics using DBMS_STATS
 
323090 - Performance problems due to degenerated indexes
 
314719 - BW2.0 ORACLE FEATURES
 
184905 - Collective note Performance BW 2.0
 
156319 - Collective note performance BW 1.2B
 
16083 - Standard jobs, reorganization jobs

1 comment:

Unknown said...

The post is really informative, you have discussed the primary things that one should kept in mind There are numerous ways you have stuffed here and share your awesome information. SAP APO Online Training