Vous êtes sur la page 1sur 9

DB2 9 for z/OS Performance Topics

by Paolo Bruni et al.


IBM Corporation. (c) 2009. Copying Prohibited.

Reprinted for Arunprakash Gnanavel, CSC


agnanavel@csc.com
All rights reserved. Reproduction and/or distribution in whole or in part in electronic,paper or
other forms without written permission is prohibited.

Chapter 10: Performance Tools
DB2 Performance Tools for z/OS help with analyzing performance data, make recommendations to optimize queries, and
maintain high availability by sensing and responding to situations that could result in database failures and system
outages.
10.1 IBM Tivoli OMEGAMON XE for DB2 Performance Expert on z/OS
OMEGAMON XE for DB2 Performance Expert on z/OS is a host-based performance analysis and tuning tool for z/OS
environments. Its main objective is to simplify DB2 performance management. OMEGAMON XE for DB2 Performance
Expert lets you monitor threads, system statistics, and system parameters by using a single tool. It integrates performance
monitoring, reporting, buffer pool analysis, and a Performance Warehouse function. It also provides a single overview
system that monitors all DB2 subsystems and DB2 Connect gateways in a consistent way.
OMEGAMON XE for DB2 Performance Expert includes the following advanced capabilities:
n Analyzes and tunes the performance of DB2 and DB2 applications
n Provides expert analysis, a real-time online monitor, and a wide range of reports for analyzing and optimizing DB2
applications and SQL statements
n Includes a Performance Warehouse feature for storing performance data and analysis functions, and for collecting
report data
n Defines and applies analysis functions, such as rules of thumb and queries, to identify performance bottlenecks
n A starter set of smart features that provide recommendations for system tuning to gain optimum throughput
n An explain feature
n A Reporting function that presents detailed information about DB2 events that involve CPU times, buffer pool usage,
locking, I/O activity, and more
n A buffer pool analysis function that collects data and provides reports on related event activity to get information about
current buffer pool behavior and simulate anticipated future behavior
It can provide these reports in the form of tables, pie charts, and diagrams.
n Exception reports for common performance problems to help identify and quantify excessive CPU and elapsed time on
a plan and package basis
n Monitors connections of remote applications using Performance Expert Agent for DB2 Connect Monitoring
The availability of these functions, however, varies depending on whether you install OMEGAMON XE for DB2
Performance Expert or the stand-alone product DB2 Performance Manager.
Figure 10-1 shows how to monitor the detailed DB2 statistics information by using the OMEGAMON XE for DB2
Performance Expert client.
DB29forz/OSPerformanceTopics
ReprintedforCSC/agnanavel,CSC IBMCorporation,InternationalBusinessMachinesCorporation(c)2009,CopyingProhibited
Page 2 / 9

Figure 10-1: DB2 statistics details in OMEGAMON XE for DB2 Performance Expert client
The OMEGAMON XE for DB2 Performance Expert client supports the new storage layout of the EDM pool in DB2 V9. See
Figure 10-2.

Figure 10-2: EDM pool information in OMEGAMON XE for DB2 Performance Expert client
The batch reporting facility presents historical information about the performance of the DB2 system and applications in
reports and data sets. System-wide performance data shows information about topics such as CPU times, buffer pool
usage, locking, log activity and I/O activity. Application data shows how individual programs behave in DB2.
DB29forz/OSPerformanceTopics
ReprintedforCSC/agnanavel,CSC IBMCorporation,InternationalBusinessMachinesCorporation(c)2009,CopyingProhibited
Page 3 / 9
The batch reporting facility uses DB2 instrumentation data to generate performance reports in a form that is easy to
understand and analyze.
You can use OMEGAMON XE for DB2 Performance Expert to:
n Determine DB2 subsystem performance and efficiency
n Identify and resolve potential problems
n Tune the DB2 subsystem
n Measure an application's performance and resource cost
n Tune applications and SQL queries
n Assess an application's effect on other applications and the system
n Gather information for cost purposes
OMEGAMON XE for DB2 Performance Expert provides information at various levels of detail depending on your needs.
Recent Changes on Virtual Storage Analysis
Some formulas for virtual storage management, based mostly on the content of IFCID 225 records, have changed with
recent maintenance:
PK49126 / UK28017 for PE V2
PK50719 / UK28017 for PM V8
PK49139 / UK27963 for OMPE V3
PK49139 / UK27964 for OMPE V4
The changed values are reported in the Statistics Details panel (shown in Figure 10-1 on page 287) and in the batch
statistics report.
Average Thread Footprint (MB)
Average thread footprint (MB) now shows the current average memory usage of user threads (allied threads + DBATs). It
is calculated as follows:
(TOT_VAR_STORAGE - TOT_AGENT_SYS_STRG)/(ACT_ALLIED_THREADS + ACTIVE_DBATS)
Maximum Number of Possible Threads
The maximum number of threads is shown as an integer value both in the statistics reports and the classic online interface.
It shows the maximum number of possible threads. Its value depends on the storage size and the average memory usage
of active user threads. It is calculated as:
(EXT_REG_SIZE_MAX - (200*1024*1024) - (TOT_GETM_STORAGE + TOT_GETM_STCK_STOR))/
((TOT_VAR_STORAGE - TOT_AGENT_SYS_STRG) / (ACT_ALLIED_THREADS + ACTIVE_DBATS))
In addition, for the batch reports, another pair of values is shown.
Average Thread Footprint (TYPE II) (MB)
The average thread footprint is the current average memory usage of active allied threads and the maximum number of
active DBATs that existed. The formula that is used for this value is suited for enterprise resource planning (ERP) systems,
such as SAP. The formula is:
(TOT_VAR_STORAGE - TOT_AGENT_SYS_STRG - LOC_DYN_CACHE_POOL)/
(ACT_ALLIED_THREADS + MAX_ACTIVE_DBATS)

Maximum Number of Possible Threads (TYPE II)
The maximum number of possible threads depends on the storage size and average memory usage of active allied threads
and the maximum number of active DBATs that existed. The formula is:
NoteOMEGAMON XE for DB2 Performance Expert V4.1 supports DB2 V9 when APAR PK36297 and PK40691 are
applied.
DB29forz/OSPerformanceTopics
ReprintedforCSC/agnanavel,CSC IBMCorporation,InternationalBusinessMachinesCorporation(c)2009,CopyingProhibited
Page 4 / 9
(EXT_REG_SIZE_MAX - BIT_EXT_LOW_PRI_31- MIN((EXT_REG_SIZE_MAX/8),(200*1024*1024))
- (TOT_GETM_STORAGE + TOT_FIXED_STORAGE + LOC_DYN_CACHE_POOL
+ TOT_AGENT_SYS_STRG))/((TOT_VAR_STORAGE - TOT_AGENT_SYS_STRG -
LOC_DYN_CACHE_POOL)/(ACT_ALLIED_THREADS + MAX_ACTIVE_DBATS))
10.2 Optimization Service Center and Optimization Expert
In this section, we explain IBM Optimization Service Center for DB2 for z/OS and DB2 Optimization Expert for z/OS. For
more information see IBM DB2 9 for z/OS: New Tools for Query Optimization, SG24-7421.
10.2.1 IBM Optimization Service Center
IBM Optimization Service Center for DB2 for z/OS is a workstation tool for monitoring and tuning the SQL statements that
run as part of a workload on your DB2 for z/OS subsystem. Optimization Service Center has replaced and enhanced Visual
Explain.
When you start Optimization Service Center for the first time, you see the Welcome panel (Figure 10-3).

Figure 10-3: Optimization Service Center welcome panel
From the Welcome panel, you can select to configure a DB2 subsystem, view query activity, tune a single query, view
workloads, tune a workload, or view monitor profiles.
n Reactive tuning: Optimization tools for problem SQL queries
You can use Optimization Service Center to identify and analyze problem SQL statements and to receive expert
advice about statistics that you might gather to improve the performance of problematic and poorly performing SQL
statements on a DB2 for z/OS subsystem.
Optimization Service Center makes it easy for you to get and implement expert statistics recommendations. After
you identify a problem query, you can run the Statistics Advisor, which provides advice about statistics that you
should update or collect to improve the performance of a query. Optimization Service Center generates control
statements that can be used to collect and update needed statistics with the RUNSTATS utility and allows you to
invoke the RUNSTATS utility directly from your workstation.
You can view query activity from a number of sources, including the DB2 catalog (plan or package), statement cache,
Query Management Facility (QMF), and so on. You can even import a query from a file or copy and paste the query
text into your project. See Figure 10-4.
You can quickly "snap the cache" of your DB2 subsystem to understand which dynamic queries have been running and
DB29forz/OSPerformanceTopics
ReprintedforCSC/agnanavel,CSC IBMCorporation,InternationalBusinessMachinesCorporation(c)2009,CopyingProhibited
Page 5 / 9
to discover which of those queries might be causing performance problems on your DB2 for z/OS subsystem.
n Proactive tuning: Optimization tools for monitoring and tuning SQL workloads
You can use Optimization Service Center to identify and analyze groups of statements and receive expert advice
about statistics that you can gather to improve the performance of entire SQL workloads.
An SQL workload is any group of statements that run on your DB2 subsystem. You define a workload by creating a
set of criteria that identifies the group of statements that make up the workload. For example, you might create a
workload to capture all of the statements in a particular application, plan, or package.
When you have optimized the performance of SQL queries that run on your DB2 for z/OS subsystem, you can
create monitor profiles that monitor the health of SQL processing on the subsystem and alert you when problems
develop and when more tuning activities might be advised.
You can create monitor profiles that record information about the normal execution of static and dynamic SQL
statements.
You can create monitor profiles that record information about the execution of SQL statements when the execution
exceeds specific thresholds during processing.
You can capture a set of SQL statements from a DB2 for z/OS subsystem. You might capture statements from the
statement cache, from the DB2 catalog, from QMF, from a file on your workstation, or from another workload. You
can specify filter criteria to limit the number and type of statements that you capture.
You can use the workload Statistics Advisor to gain expert advice regarding statistics that you can collect or update
to improve the overall performance of the statements that make up an SQL workload. Optimization Service Center
generates control statements that can be used to collect and update needed statistics with the RUNSTATS utility
and even allows you to invoke the RUNSTATS utility directly from your workstation.
The Statistics Advisor recommends statistics that you should update or collect to improve the performance of a
particularly hot query. See Figure 10-5.
n Advanced tuning: Optimization tools for experienced database administrators
Powerful Optimization Service Center optimization tools enable the experienced DBA to understand, analyze,
format, and optimize the SQL statements that run on a DB2 for z/OS subsystem.
By using Optimization Service Center, you can automatically gather information from DB2 EXPLAIN, which is an
SQL function that populates tables with information about the execution of SQL statements. The primary use of
EXPLAIN is to capture the access paths of your statements. EXPLAIN can help you when you need to perform the
following tasks:
l Determine the access path that DB2 chooses for a query
l Design databases, indexes, and application programs
l Determine when to rebind an application
Optimization Service Center automatically formats an SQL statement into its component query blocks and presents
the query so that you can read it. You can click a tab to see how the DB2 optimizer transforms a query for
processing.
Optimization Service Center provides graphical depictions of the access plans that DB2 chooses for your SQL
statements. Such graphs eliminate the need to manually interpret plan table output. The relationships between
database objects, such as tables and indexes, and operations, such as tablespace scans and sorts, are clearly
illustrated in the graphs. You can use this information to tune your queries.
Optimization Service Center provides a way for experienced DBAs to graphically create plan hints that specify an
access method for all or part of the access plan for an SQL statement and deploy those plan hints to the DB2 for
z/OS subsystem.
DB29forz/OSPerformanceTopics
ReprintedforCSC/agnanavel,CSC IBMCorporation,InternationalBusinessMachinesCorporation(c)2009,CopyingProhibited
Page 6 / 9

Figure 10-4: Optimization Service Center view queries

Figure 10-5: Optimization Expert Statistics Advisor
10.2.2 DB2 Optimization Expert for z/OS
IBM DB2 Optimization Expert for z/OS has the same Statistics Advisor as Optimization Service Center. However
Optimization Expert also offers a comprehensive set of index, query, and access path advisors to improve system
performance and lower total cost of ownership.
You can use Optimization Expert to identify and analyze groups of statements and receive expert advice about measures
DB29forz/OSPerformanceTopics
ReprintedforCSC/agnanavel,CSC IBMCorporation,InternationalBusinessMachinesCorporation(c)2009,CopyingProhibited
Page 7 / 9
that you can take to improve the performance of entire SQL workloads. Optimization Expert makes it easy for you to get
and implement expert tuning recommendations. After you identify a problem query, you can run any or all of the expert
advisors.
Optimization Expert generates control statements that you can use to collect and update needed statistics with the
RUNSTATS utility and allows you to invoke the RUNSTATS utility directly from your workstation. The RUNSTATS jobs of
DB2 Optimization Expert captures statistics beyond those that you get by using RUNSTATS ALL.
The Query Advisor recommends ways that you can rewrite an SQL query to improve performance. See Figure 10-6.

Figure 10-6: Optimization Expert Query Advisor
Optimization Expert considers a number of different conditions and recommends best-practice fixes to common query-
writing mistakes. The Index Advisor recommends indexes that you might create or modify to enhance the performance of
an SQL query. See Figure 10-7.
DB29forz/OSPerformanceTopics
ReprintedforCSC/agnanavel,CSC IBMCorporation,InternationalBusinessMachinesCorporation(c)2009,CopyingProhibited
Page 8 / 9

Figure 10-7: Optimization Expert Index Advisor
The Index Advisor also generates the CREATE INDEX statements that you can use to implement the recommendations,
and enables you to execute those statements on the DB2 subsystem directly from your workstation.
DB29forz/OSPerformanceTopics
ReprintedforCSC/agnanavel,CSC IBMCorporation,InternationalBusinessMachinesCorporation(c)2009,CopyingProhibited
Page 9 / 9

Vous aimerez peut-être aussi