Cost Based Optimization Guide For Siebel
Cost Based Optimization Guide For Siebel
Cost Based Optimization Guide For Siebel
Table of Contents
Document Overview .......................................................................................................... 3 Siebel CRM Versions and Supported Oracle Database Versions...................... 4 Transitioning from RBO to CBO ............................................................................ 5 Transitioning from Oracle CBO 9i to Oracle CBO 10g.................................. 5 Cost Based Optimizer Statistics.................................................................................... 6 Collecting Optimizer Statistics .............................................................................. 6 Deleting Optimizer Statistics ................................................................................. 7 Locking Optimizer Statistics ................................................................................... 7 System Optimizer Statistics ................................................................................... 8 Know When to Create a Stored Outline .................................................................... 8 Fix the root cause, not the symptom! ............................................................... 8 Dropping Outlines ...................................................................................................... 9 Peeking of User Binds in Siebel CRM .......................................................................... 9 Double Hard Parse in Siebel 7.7/7.8 ................................................................ 10 No Bind Peeking in Siebel 8.0/8.1 ..................................................................... 10 Single Hard Parse in Siebel 8.1.1 ...................................................................... 10 Environment Variable SIEBEL_ORA_BIND_PEEK ........................................ 11 Recommendations for Customers Affected by Issues Related to Peeking of User Binds ........................................................................................................................... 11 Hidden parameter _optim_peek_user_binds ................................................ 12 Preparing and Administrating the Siebel Database for CBO ........................... 13 Default Database Parameters for Oracle 9i and 10g ................................. 13 Recommended Database Parameters for Oracle 9i and 10g .................. 13 Hidden Parameters in Oracle 10G ..................................................................... 16 Parameter OPTIMIZER_INDEX_COST_ADJ .................................................... 17 Recommended Database Parameters for Oracle 11g ................................ 18 Hard-coded Session Parameters for Siebel OM Sessions ......................... 18 Bibliography and Useful References ......................................................................... 19 Oracle Corporation Documentation ................................................................... 19 Siebel Product Defects Affecting Performance on Oracle RDBMS ................. 20 Oracle Product Defects Affecting Siebel .................................................................. 21 Oracle 9i Product Defects...................................................................................... 21 Oracle 10g Product Defects .................................................................................. 22 Oracle 11g Product Defects .................................................................................. 22
2
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
Document Overview
The purpose of this document is to publish a formal recommendation for Siebel CRM configuration and performance tuning on the Oracle database platform. Siebel CRM performance tuning is a complex area. There is no one size fits all solution. A well-tuned out-of-box Siebel CRM configuration may need to be further enhanced for most implementations given the different data volume, the data shape, the transaction mix, and the customizations, etc. Multiple documents and recommendations exist on this subject from different sources, which are either too general or too specific. Many times those documents contradict each other, and even deviate from what Siebel CRM performance experts recommend. This document is an attempt to reconcile all documents published in the past. It provides concise guidelines on key areas that affect performance of Siebel CRM application deployed on the Oracle database platform. It defines a set of basic rules to implement for Siebel CRM configuration and performance tuning on the Oracle database platform. If such rules are meticulously deployed, it should lay down a solid foundation for further performance tuning. This document should be used in conjunction with Siebel CRM Troubleshooting Guide, which is currently being developed.
3
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
Siebel 7.7
Siebel 7.7
Oracle 9i Enterprise Server Oracle 10g Enterprise/Standard Server Oracle 11g Enterprise/Standard Server Oracle 9i Enterprise Server Oracle 10g Enterprise/Standard Server Oracle 11g Enterprise/Standard Server Oracle 10g Enterprise/Standard Server Oracle 11g Enterprise/Standard Server Oracle 10g Enterprise/Standard Server Oracle 11g Enterprise/Standard Server
Siebel 7.7
8.1.7.4 + p1744093 or above for Unix 8.1.7.4.6 or above for Windows 9.2.0.4 or above and within the 9.2.0.x series 10.1.0.3 or above, Including 10gR2 10.1.0.3 or above, Including 10gR2 9.2.0.4 or above and within the 9.2.0.x series 10.1.0.3 or above, Including 10gR2 11.1.0.6 or above
RBO
CBO
CHOOSE
CBO
ALL_ROWS
Siebel 7.7
CBO
ALL_ROWS
Siebel 7.8
CBO
CHOOSE
Siebel 7.8
CBO
ALL_ROWS
Siebel 7.8
CBO
ALL_ROWS
Siebel 8.0
10.2.0.2 or above
CBO
ALL_ROWS
Siebel 8.0
11.1.0.6 or above
CBO
ALL_ROWS
Siebel 8.1
Siebel 8.1
CBO
ALL_ROWS
CBO
ALL_ROWS
With the exception of Siebel CRM version 7.7 on Oracle 8i Enterprise Server, all the above listed Siebel CRM versions can only be configured to use the Cost Based Optimizer (CBO). This differs from the recommended configuration for pre-Siebel 7.7 CRM versions, which utilized the Rule Based Optimizer (RBO) on Oracle 8i Enterprise Server. In the vast majority of cases, performance of the Siebel application with properly implemented and configured CBO will meet or exceed RBO performance, ceteris paribus (i.e. under similar architecture/network topologies, hardware configurations, data
4
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
volumes/distributions, storage characteristics, etc.). Detailed discussion of the RuleBased Optimizer (RBO) is beyond the scope of this document. The following provides general guidelines for RBO to CBO migration.
5
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
parallel with deployment of a customer application release may need to allocate some additional development time for performance tuning.
EXECUTE DBMS_STATS.GATHER_TABLE_STATS ( ownname => '<table owner>' , tabname => '<table name>' , method_opt => 'FOR ALL INDEXED COLUMNS SIZE 254' , granularity => 'ALL' , cascade => TRUE , degree => DBMS_STATS.DEFAULT_DEGREE );
It is critical to note that we do not recommend collecting histograms statistics for all columns. Such histograms statistics can be created only for tables with highly skewed data where some values have a disproportional number of rows. Unnecessary introduction of histograms in the statistics collection is one of the most common mistakes. We strongly recommend that the optimizer statistics histograms be created using 'for all indexed columns size 254' method (please see the syntax in the above example). However, there are a few exceptions to this rule. Some tables in Siebel CRM schema are known to have skewed data, and collection of all column statistics histograms may lead to generation of better query plans. Below is the list of such tables, along with the recommended method and syntax to create the optimizer statistics:
Siebel Table Name S_POSTN_CON S_ORG_BU S_ORG_GROUP Oracle Optimizer Statistics Collection Method FOR ALL COLUMNS SIZE 254 FOR ALL COLUMNS SIZE 254 FOR ALL COLUMNS SIZE 254
6
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
One needs to benchmark the application performance to make sure that full column statistics histograms do help in their environment.
EXECUTE DBMS_STATS.DELETE_TABLE_STATS ( ownname => '<table owner>' , tabname => '<table name>' );
There are a few cases when we recommend deleting optimizer statistics collected for Siebel CRM data tables: We recommend using 'for all indexed columns size 254' to generate statistics before any query tuning. If the statistics were created differently, it is necessary to delete them1 and recreate a new set of the optimizer statistics using 'for all indexed columns size 254' method before starting the query tuning.
Regenerating statistics using 'for all indexed columns size 254' may not clean-up entirely the previous statistics. Therefore, the statistics must be deleted first to make sure there are no residuals.
7
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
In certain cases, CBO ignores the Outline if it cannot use it. For example, if an index that the Outline is supposed to use is dropped the CBO will ignore the Outline and generates a new query plan.
8
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
Stored Outlines may cause performance degradations after the Oracle database upgrade since each database version may retire a set of database parameters that affect the query plan preserved by the Stored Outlines. It is also important to understand that although in Oracle 11g release the Stored Outlines continue to function as in past releases, support for Stored Outlines will be deprecated in future releases of Oracle database. Oracle strongly recommends that you use SQL plan management for new applications. SQL plan management creates SQL plan baselines, which offer superior SQL performance and stability compared with stored outlines. However, the recommendation remains the same no matter what tool is used: Fix the root cause, not the symptom!
Dropping Outlines
To comply with the above recommendation, it may be necessary to identify the Stored Outlines that exist in the environment, check if the outlines have been used, and understand their intended usage. [USER|ALL|DBA]_OUTLINES view should be used to display information about existing outlines:
9
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
leverage optimizer statistics and generate the most efficient query plan for given value. Disabling of bind peeking, or inaccurate statistics, or excessive histogram statistics may equally result in generation of suboptimal query execution plans, and noticeable degradation in Siebel CRM application views response times.
However, no-bind-peek implementation caused performance degradation in some Siebel CRM application views for customers who already tuned their application using bind peeking with double hard parse.
10
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
It is important to understand that variable SIEBEL_ORA_BIND_PEEK does not address the original issue of double hard parse with bind peeking. It is designed to eliminate performance issues for Siebel CRM customers who have already tuned their application with the double hard parse.
11
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
7.7.2.12 Fix Pack Build2 [18391] 7.8.2.10[19241]QF0A52 7.8.2.11[19244]QF0B09 7.8.2.13 Fix Pack 8.0.0.6 [20423]QF0637 8.0.0.6 Quick Fix 26xx Branch 8.0.0.7 [20426]QF0707 8.0.0.7 [20426]QF1703 8.0.0.7 Quick Fix 17xx Branch 8.0.0.8 Fix Pack Build2[20428] 8.0.0.9 Fix Pack 8.1.1 [21112] QF0023 8.1.1.2 Fix Pack BLD_DEN_11_APPS_SIA
Siebel 8.0
12
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
It is always a good idea to set the OPTIMIZER_FEATURES_ENABLE = <Oracle DB patch version being used> to get full benefit of a series of optimizer feature supported by Oracle DB version. Hence, if your db version is already 10.2.x, then you can set the OPTIMIZER_FEATURES_ENABLE=10.2.x.
OPTIMIZER_DYNAMIC_SAMPLING This parameter controls the level of dynamic sampling performed by the optimizer. OPTIMIZER_MAX_PERMUTATIONS This parameter restricts the number of permutations of the tables the optimizer will consider in queries with joins. A higher value result in
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
2000
** Obsolete
100
13
higher parse time, a lower value carries the risk of overlooking a good plan. NOTE: Starting with Oracle Database 10g, this parameter has been made obsolete. Refer to the Oracle documentation for further information. OPTIMIZER_INDEX_COST_ADJ Controls the access path 100 100 1 selection to be more or less index friendly. QUERY_REWRITE_ENABLED Enable or disable query False True False rewriting globally for the database (**) Do not automatically alter the values of these parameters, which have been deprecated to hidden parameters in 10g, based on the recommendations for visible parameters in version 9i. The parameters below should be set according to the information documented in the following Siebel Bookshelf references: Siebel Installation Guide for Microsoft Windows Version 8.0 > Configuring the RDBMS > Configuring an Oracle Database for Siebel Applications > Guidelines for Configuring Settings in the init.ora File. Siebel Installation Guide for UNIX Version 8.0 > Configuring the RDBMS > Configuring an Oracle Database for Siebel Applications > Guidelines for Configuring Settings in the init.ora File. Siebel Installation Guide for Microsoft Windows: Servers, Mobile Web Clients, Tools Version 7.8 > Configuring the RDBMS > Configuring Oracle for Siebel Applications > Guidelines for Configuring Settings in the init.ora File. Siebel Installation Guide for UNIX: Servers, Mobile Web Clients, Tools Version 7.8 > Configuring the RDBMS > Configuring Oracle for Siebel Applications > Guidelines for Configuring Settings in the init.ora File. Siebel Installation Guide for Microsoft Windows: Servers, Mobile Web Clients, Tools Version 7.7 > Guidelines for Configuring the RDBMS > Configuring Oracle for Siebel Applications. Siebel Installation Guide for UNIX: Servers, Mobile Web Clients, Tools Version 7.7 > Guidelines for Configuring the RDBMS > Configuring Oracle for Siebel Applications. Recommended Value DB_FILE_MULTIBLOCK_READ_COUNT The database buffer cache For most implementations, parameter dictates the this value should be set number of data blocks read between 16 and 32 blocks in a single Oracle I/O and adjusted as necessary. operation during a table You may want to set an scan. initial value of 32. SORT_AREA_SIZE This value is specified in Set bytes, and may be adjusted PGA_AGGREGATE_TARGET according to the number of instead. When not setting users, the amount of RAM PGA_AGGREGATE_TARGET available, and the size of - You should start with an Oracle Parameter Description
14
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
sorted queries.
SORT_AREA_RETAINED_SIZE
Specifies (in bytes) the maximum amount of the user global area (UGA) memory retained after a sort run completes. The retained size controls the size of the read buffer, which Oracle uses to maintain a portion of the sort in memory.
initial value of 1,000,000 (1 MB). Optimal performance can be achieved for the Dictionary Managed TEMP tablespaces if the extents are uniform and a multiple of the SORT_AREA_SIZE. Set PGA_AGGREGATE_TARGET instead. When not setting PGA_AGGREGATE_TARGET - Derived from SORT_AREA_SIZE.
The following related parameters should be set by a trained DBA and according to the information in the applicable Oracle database documentation and requirements for your implementation. General guidance on these related settings is provided below: Oracle Parameter PGA_AGGREGATE_TARGET Description Specifies the target aggregate PGA memory available to all server processes attached to the instance. General Guidance For most production implementations with a substantial number of users, this value should be set to 1 GB or greater. Monitor PGA target advisory views for additional guidance. All the advisories in Oracle9i TYPICAL in production and Release 2 including the ALL in TEST environments. Buffer Cache Advisor are controlled by a newly introduced parameter STATISTICS_LEVEL. Relevant to parallel Set execution operations and to PGA_AGGREGATE_TARGET the query portion of DML or instead. When not setting DDL statements. It specifies PGA_AGGREGATE_TARGET the maximum amount of - Derived: 2 * memory, in bytes, to be SORT_AREA_SIZE used for hash joins. Specifies the policy for If sizing work areas. This PGA_AGGREGATE_TARGET parameter controls the is set, then AUTO. If mode in which working PGA_AGGREGATE_TARGET areas are tuned. is not set, then MANUAL.
STATISTICS_LEVEL
HASH_AREA_SIZE
WORKAREA_SIZE_POLICY
15
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
Always use this OFF method for semi- In some cases, setting _always_semi_join to OFF join when possible renders better performance. This is due to Siebel OMs FIRST_ROWS_10 optimization strategy. However, it is recommended that a customer run a thorough performance testing to verify whether this setting improves performance in the Siebel environment Enable the use of bitmap plans for tables with only Btree indexes Determine how long to defer down converts for hot buffers FALSE For Siebel OLTP environment, it is recommended to set _b_tree_bitmap_plans to FALSE and _partition_view_enabled to FALSE 0 For a Siebel RAC implementation, it is recommended to set _gc_defer_time to 0. This is applicable to Oracle 9i and 10g environments
_b_tree_bitmap_plans
_gc_defer_time
_no_or_expansion
OR expansion FALSE during optimization Some customers report setting this parameter to is disabled TRUE is providing better performance. However, Siebel does not perform better consistently with this setting. It is recommended to set this parameter to FALSE 100 Starting with Oracle Database 10g, optimizer_max_permutations is an obsolete parameter. It is recommended to leave this hidden parameter setting to its default value FALSE For Siebel OLTP environment, it is recommended to set _partition_view_enabled to FALSE and _b_tree_bitmap_plans to FALSE
_optimizer_max_permuta Limit the optimizer tions maximum join permutations per query block
_partition_view_enabled
16
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
Parameter OPTIMIZER_INDEX_COST_ADJ
This parameter is of critical importance for Siebel CRM application performance. Incorrect setting may result in severe performance degradation of Siebel CRM application. For Oracle 9i CBO setting OPTIMIZER_INDEX_COST_ADJ = 1 is imperative. This will set the optimizer goal for best response time (versus best throughput). Incorrect setting may cause the optimizer to favor full-table scans instead of index access. For Oracle 10g/11g CBO setting OPTIMIZER_INDEX_COST_ADJ = 1 is also recommended, although the default setting of 100 will deliver good results in most cases.
It is important to understand that in-house tuning of Siebel CRM application was performed with OPTIMIZER_INDEX_COST_ADJ = 1 setting. This means that customers who want to implement OPTIMIZER_INDEX_COST_ADJ = 100 on Oracle 10g/11g will need to allocate extra development time for additional tuning that may be necessary. The need for such tuning is not considered to be an optimizer defect or a regression issue. Oracle Engineering will only review cases when it is confirmed that a specific query performance is equally unacceptable both under OPTIMIZER_INDEX_COST_ADJ = 1 and OPTIMIZER_INDEX_COST_ADJ = 100 settings. In all other cases, additional tuning should be provided on-site, or OPTIMIZER_INDEX_COST_ADJ setting should be reverted to 1. Under no circumstances OPTIMIZER_INDEX_COST_ADJ parameter should be set to values other than 1 (Siebel recommended) or 100 (Oracle default on 10g/11g).
17
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
The above session parameters should not be altered to other values by any means.
18
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
19
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
12-1TK6KQ9
12-1TK6KQU (Aspen) 12-1TK9A1L (8.0.0.8 FP) 12-1UI7Y8T (7.7.2.10 QF) 12-1UIA88O (7.7.2.12 FP) 12-1UIA89R (7.8.2.x FP) 12-1UIA8AQ (8.1.1.2 FP) 12-1V14HVD (7.7.2.8 QF)
20
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
Bug 2991526
Fixed in 9.2.0.5
Bug 4275247
Internal only.
Bug 3380026 Bug 3220073 Bug 3075139 Bug 3018146 Bug 3566843 Bug 4335559
Fixed in 9.2.0.6 Fixed in 9.2.0.5 Fixed in 9.2.0.5. Fixed in 9.2.0.5 Fixed in 9.2.0.7 Fixed in 9.2.0.6
21
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
7430474
6990305 7236148 Note 406966.1 Note 4724074.8 Bug 6455161 Bug 5240607 Note 4878299.8 Bug 7891471
Higher "cache buffer chains" latch gets / higher "consistent gets" after truncate/Rebuild FIRST_K_ROWS may choose inefficient NESTED LOOPS join Bad plan from join with FIRST_ROWS_N or a ROWNUM predicate Query with ORDER BY has a bad plan with FIRST_ROWS_10 optimization in 10.2.0.4 "cache buffer chains" latch contention from concurrent index range scans in extreme situations, excessive CPU consumption without any user-SQL activity.
Fixed in 10.2.0.5
Bug 4742607
Fixed in 10.2.0.3
22
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide December 2008 Authors: James Qiu, Paul Blokhin, Mehdi Gerami Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065 U.S.A. Worldwide Inquiries: Phone: +1.650.506.7000 Fax: +1.650.506.7200 oracle.com Copyright 2008, Oracle. All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission. Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
23
Performance Tuning Guide for Siebel CRM Application on Oracle Part I - Cost-Based Optimization Guide