BWI User Group.ppt

  • View

  • Download

Embed Size (px)



Text of BWI User Group.ppt

  • 1. Optimizing SQL Performance with BMC SQL Performance for DB2 Introduction and Technical Update

2. The Business Problem

  • SQL Performance
    • The most challenging problem in DB2 shops today
      • Direct impact on meeting service level objectives
      • Direct impact on cost of ownership for the IT organization
    • What makes it difficult?
      • Dynamic Application Workloads
      • More and more dynamic SQL coming from distributed connections
      • SQL coding quality and validation
  • Why is this an even bigger deal today?
    • IT Dynamics driving the problem
    • Trending toward more dynamic SQL = less control
    • Outsourced application development
    • Less staff
      • People and experience to handle what is a complex task


  • Focus on individual SQL statements
    • Do they meet best practice coding standards
    • Do they use expected/accepted DB2 access paths
    • Do they deliver desired result set in acceptable time with acceptable resource consumption
  • Developed and tested in controlled environment
  • More predictive in nature
  • Focus on workload dynamics
    • How does concurrent execution affect response time/resource consumption
    • Does this SQL statement/program collide with other transactions
  • Real worldun predictability comes into play
  • More focus on measuring the workload and rapidly reacting

Analyzing and Tuning Your SQL - Sources of Information SQL Workload Atomic SQL 4. SQL Performance for DB2The BMC Solution

  • Solution Objectives
    • Control or eliminate poorly performing SQL code
    • SQL performance problems identified and solved quickly
    • Proactive identification of inefficient SQL
  • Solution Components
    • APPTUNE captures and analyzes SQL execution metrics
    • SQL Explorer is the SQL analysis tool that extends far beyond the DB2 Explain
    • Index Analysis Component provides specific features for effectively managing DB2 indexes
    • Common Explain available in solution and point products

SQL Performance for DB2 Data Collector IndexComponent SQL Explorer for DB2 APPTUNE for DB2 5. SQL Performance for DB2 Solution Architecture 6. SQL Performance for DB2 Starting at the /top

  • ASQEQRPW/PView a ReportLINE 1 OF 7
  • Command ====>_______________________________________________Scroll ===>CSR_
  • Source :V52A-ACTIVE Intvl :08/27 00:00 - UNLIMITED More:+ >
  • -------------------------------------------------------------------------------
  • Actions: G-AppGrpsR-ProgramsC-ConnIDT-DetailA-AveragesO-Object
  • P-PlansU-UsersS-StmtsE-SQL ErrorsL-CorrID
  • Actions for SAP systems: V-Server N-Work Process Number I-Work Process ID
  • AppGrp:User:ConnID:Plan:
  • CorrID:Program:Stmt No:
  • SQL+------- Total IN-SQL Time -------++- S
  • DB2 SSIDMVS IDCallsElapsed%CPU%GetpageNumb
  • ---------- -------- ------ ----------------- ----------------- -------- ----
  • +DFH1 (8.1) SYSM1815K 01:53.7947696.1%00:29.6863199.9% 1541041
  • +DFG1 (7.1) SYSO74 00:04.675283.9% 00:00.029650.1%778

Drilldowns aplenty Numerous drilldowns will take you into detail organized to your interest

  • Key points
  • DB2 subsystems across your enterprise on a single screen
  • DB2s with highest elapsed times bubble to the top (generally the best place to start)
  • Results can be sorted on different field on display (getpages or CPU for example) with simple command

Poor performance at the subsystem level 7. Which statement is using the most resources? SQL Text Objects Accessed Top three statements are using 90% of the CPU

  • Key points
  • Top SQL statements in terms of total elapsed time sorted to top
  • Dynamic and Static SQL visible
  • Numerous drilldowns for additional detail

S S again to see the SQL text 8. Heres the SQL

  • Key points
  • Provides extensive SQL statement execution detail on elapsed time, getpage activity, BP usage, lock events and CPU consumption
  • You can launch directly into a full-function explain from the common Explain function

X will invoke the common Explain function X 9. Lets Explain the statement 10. Which DB2 Objects Are Used by this Statement? 11. APPTUNE for DB2 As a Troubleshooting Tool

  • Current transaction problem ?
    • Subsystem
    • Thread
    • Locking contention
  • Do you have Distributed Applications?Do you need to identify the transaction by Workstation?
  • Need a way to report on application SQL errors?

12. APPTUNE for DB2Active Threads Running 13. SQL Error Analysis report 14. SQL Explorer for DB2

  • Explain function
    • Online interactive tool
      • See detailwhenyou want to see it on statistics, predicates, access path, objects
      • Customize the layout of the data the wayyouwant to see it
      • Get advice and tips from Explain rules
      • See visual comparison from editing SQL and re-explaining
      • See visual comparison of dynamic explain and BIND with EXPLAIN(YES)
      • Solution password enables Index Component analysis on cloned objects:
        • Add one or more indexes
        • Drop one of more indexes
        • Update statistics on one or more indexes
    • Batch
      • See summary and detail explain information for many packages, collection IDs, or plans.
      • Explain objects in batch and save to product history tables to be used in Compare

15. BMC Common Explain A Little More Detail Predicate Information 16. SQL Explorer for DB2 Additional Functionality

  • Compare Access Paths from two points in time
    • Compares onSQL Text , not statement number
    • Sets return code 8 if access path got worse
    • Shows differences in statistics that were used at the time of the Explain
  • Mismatch Analysis
    • Reports mismatches in data type or length that can affect access paths
    • Now incorporated into Explain Predicate report
  • Impact Analysis
    • Find all statements affected by a schema change
  • DBRM/LOAD Library Compare
    • Find mismatches in timestamps between DBRM and LOADbeforeyou promote to production to avoid -805 / -818 SQL errors.
  • Migrate Access Path Statistics
    • Copy PROD statistics to TEST to get a better picture of the access paths
  • Declarations Generator
    • Generates null indicator variables to help avoid coding errors

17. SQL Performance for DB2 Index Component

  • Collects predicate data
    • Number of times a column was specified in a predicate and in what manner (Indexable Equal, Indexable Range)
  • Collects I/O information for DB2 objects
    • Inactive tables and inactive indexes
    • DB2 catalog statistics for tables and indexes
    • SQL statements associated with a table
  • Collects index usage
    • Percentage of getpages from indexes
    • SQL statements associated with a table
  • Provides What-if Index analysis on cloned objects
    • Add indexes
    • Drop indexes
    • Update statistics on indexes