BMC SQL Performance Solution for DB2 on z/OS

1,651
-1

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,651
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
29
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

BMC SQL Performance Solution for DB2 on z/OS

  1. 1. BMC SQL Performance Solution for DB2 on z/OS Bill Arledge Consulting DB2 Product Manager March 2009
  2. 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 – ERP/CRM applications using atypical SQL – Outsourced application development – Less staff • People and experience 2 ©2008 BMC Software
  3. 3. Most Important DB tools › Unisphere Research survey for IDUG January ‘07 3 ©2008 BMC Software
  4. 4. Solving the Problem SQL Analysis Across the Application Life Cycle › Focus on individual SQL statements › Focus on workload execution metrics – Do they meet “best practice” coding standards? – How does concurrent execution affect response – Do they use expected/accepted DB2 access paths? time/resource consumption? – Do they deliver desired result set in acceptable time – Does this SQL statement/program collide with other with acceptable resource consumption? transactions? › Developed and tested in controlled environment – Same application › More predictive in nature • Other applications in a shared subsystem › Real world unpredictability comes into play › More focus on measuring the workload and rapidly reacting 4 ©2008 BMC Software
  5. 5. BMC SQL Performance for DB2 › Solution objectives – Control or eliminate poorly performing SQL code BMC SQL Performance – SQL performance problems identified and solved quickly for DB2 – Proactive identification of inefficient SQL › Solution components BMC APPTUNE – APPTUNE captures and analyzes SQL execution metrics for DB2 – SQL Explorer for SQL analysis that extends beyond DB2 Explain – Performance Advisor Technology adds data analysis and intelligence BMC SQL Explorer • Workload Access Path Compare prevents bad access paths for DB2 • Index Advisor provides effective management of indexes • Reorg Advisor ensures that only objects that would benefit from reorg get reorged. Performance Advisor 5 ©2008 BMC Software
  6. 6. BMC SQL Performance for DB2 BMC SQL Explorer for DB2
  7. 7. BMC SQL Explorer for DB2 Access Path Compare BMC Common Explain • Access path analysis Mismatch Analysis • Common component across BMC SQL EXPLORER for DB2 multiple BMC BMC APPTUNE for DB2 •SQL Analysis Impact Analysis •Plan & Package Management BMC MAINVIEW for DB2 •Statistics Migration BMC CATALOG MANAGER for DB2 Statistics Migration Declarations Generator 7 ©2008 BMC Software
  8. 8. Explain Output Key points • Extensive explain analysis beyond the basic EXPLAIN Rules analysis Predicate reports ‘What if’ analysis Lock activity • Customizable display allows for reordering or hiding columns • Reports toggle on and off allowing for as much detail as desired 8 ©2008 BMC Software
  9. 9. Common Explain SQL Analysis 9 ©2008 BMC Software
  10. 10. SQL Performance Common Explain Predicate Report Key points • Predicate report provides details about column usage in predicates including filter factors • Additional options including rules analysis • “What if” analysis to analyze impact of change on SQL statement access path and cost 10 ©2008 BMC Software
  11. 11. BMC SQL Explorer for DB2 Additional Functions • Compare process to identify SQL access path changes Access Path Compare Compare on SQL text, not statement number Shows differences in statistics used at time of Explain Mismatch Analysis • Identifies predicate mismatches that can impact SQL access paths BMC SQL EXPLORER for DB2 •SQL Analysis • Finds statements impacted by a schema •Plan & Package Management Impact Analysis change •Statistics Migration • Migrate optimizer statistics within and across Statistics Migration DB2 subsystems • Automatically generates DECLARE TABLE Declarations Generator statements 11 ©2008 BMC Software
  12. 12. Integrating SQL Explorer Into the Application Development Process › Identifies negative access path changes before they make it to production Customer Success › Easy two-step process Story –1. Execute SQL Explorer Batch analysis after every bind or Large financial services rebind organization implemented • IF analysis passes standards, proceed with Compare; ELSE reject SQL Performance for DB2 –2. Prior to production promotion, execute SQL Explorer to automate SQL change Compare of OLD and NEW package, plan or DBRM validation process • IF access path degradation not detected, proceed with change promotion; ELSE Reject Benefit - Customer now › Compare uses historical baseline snapshots avoids 90+ % of reviews on SQL changes saving –Detects differences in Access paths, SQL Text, and 300 man-months per month Catalog Stats for review meetings › Use as part of your V8/V9 migration plans 12 ©2008 BMC Software
  13. 13. BMC SQL Performance for DB2 BMC APPTUNE for DB2
  14. 14. BMC APPTUNE for DB2 An Introduction STATEMENTA › Collects detailed performance Accumulate totals for STATEMENTA + execution data at the statement level STATEMENT A – Details rolled up at multiple levels Capture SQL TEXT (no trace required) – Extensive filtering Accumulate totals for PACKAGEA PACKAGEA – Support for dynamic and static SQL PACKAGE • Including host variables A › Captures detailed performance data at the object level PLANA – Getpage details PLAN Accumulate totals for PLANA A – BP Hit ratios – I/O response times › Linkages between SQL and object SSID Accumulate totals for DB2P DB2P usage DB2P 14 ©2008 BMC Software
  15. 15. BMC APPTUNE Collection Keys & Options Important Points • Monitoring Requirements vary by application across subsystems • Options set using filters that identify unique tuning requirements by application 15 ©2008 BMC Software
  16. 16. BMC APPTUNE for DB2 Starting at the Top Drilldown to more detail Numerous drilldowns will take you into detail organized to your interest Performance characteristics at the subsystem level 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 16 ©2008 BMC Software
  17. 17. SQL Statement Drilldown Key points • Top SQL statements in terms of total elapsed time sorted to top • Dynamic and Static SQL visible • Numerous drilldowns for additional detail Top three statements are using 90% of “S” again to see the SQL text the CPU S 17 ©2008 BMC Software
  18. 18. Extensive SQL Detail by Statement Key points • Provides extensive SQL statement execution detail CPU and elapsed time Getpage activity BP usage Lock activity • Launch directly into a full- function explain from the common Explain function • Hyperlink directly to objects accessed by this statement “O” will take you to object detail by SQL statement O 18 ©2008 BMC Software
  19. 19. Object Details for This Statement Key points • Provides object level access information for each SQL statement # of getpages I/O response times BP hit ratios Lock activity Includes system level objects • Object level reports also show object access in aggregate across the DB2 19 ©2008 BMC Software
  20. 20. Extensive SQL Detail by Statement Key points • Provides extensive SQL statement execution detail CPU and elapsed time Getpage activity BP usage Lock activity • Launch directly into a full- function explain from the common Explain function • Hyperlink directly to objects accessed by this statement “E” will take us to errors for this statement E 20 ©2008 BMC Software
  21. 21. Error Analysis Report Key points • Identifies SQL Errors List of all occurrences Details on each occurrence By user/plan/program 21 ©2008 BMC Software
  22. 22. Extensive SQL Statement Detail Key points • Launch directly into a full- function explain from the common Explain function “X” will invoke the common Explain function X 22 ©2008 BMC Software
  23. 23. Explain Output Key points • Extensive explain analysis beyond the basic EXPLAIN Rules analysis Predicate reports “What if” analysis Lock activity • Customizable display allows for reordering or hiding columns • Reports toggle on and off allowing for as much detail as desired 23 ©2008 BMC Software
  24. 24. APPTUNE – the SQL Optimization Solution › Basic SQL tuning can substantially reduce CPU cost right out of the box – Identifies and helps resolve problem SQL Customer Success • Bad statements bubble to the top Story –Identify object performance problems –Reduces overall CPU requirements Large mid-west manufacturer › Service levels improve as CPU cost goes down with large IMS/DB2 application utilizing APPTUNE for DB2 › Productivity Increases to tune their SQL –Minimal clicks to improved performance –Analysis and recommendations indicate possible problem Benefit - Reduced IMS/DB2 resolutions application cost by 2.1 M seconds and $340,000 on an annual basis 24 ©2008 BMC Software
  25. 25. BMC SQL Performance for DB2 Solution-Only Components
  26. 26. BMC 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 – Index usage breakdown by READ, UPDATE, DELETE, INSERT – DB2 catalog statistics for indexes › Collects application index usage detail – Percentage of getpages from indexes by SQL statement – Identifies indexes not being used for READ access – Identifies indexes not being used optimally – Identifies tables not using indexes for READ access › Provides What-if index analysis on an SQL statement – Model a new index – Add an index………What’s the Effect? – Drop an index……What’s the Effect? 26 ©2008 BMC Software
  27. 27. BMC SQL Performance for DB2 Index Component Reporting Index Component Details • Indicates % of total getpages executed against the indexes Tables with low percentage of access via index good starting point Hyperlink to the statement list for this table • Provides synchronous I/O information including response times • Drill down to additional detail on statements and stats 27 ©2008 BMC Software
  28. 28. BMC SQL Performance for DB2 • Access path analysis for SQL statement of What-if Index Analysis Using Cloning interest • Cloning technique that creates new objects or modifies existing objects Clones created in a BMC database so no DBD locks Objects created with DEFINE NO Objects not created till a dynamic explain is executed Objects dropped upon exiting Explain Index statistics can be modified Index DDL can be saved or imported into the process 28 ©2008 BMC Software
  29. 29. BMC SQL Performance for DB2 What-if Index Analysis • We’ve created a new index in this step and modified the statistics so the optimizer will have enough information • We can also delete existing indexes (deleted from the clone only) or update statistics data for existing indexes as well •Here is the index we created in the previous step •Remember the index hasn’t actually been created yet •Next step we’ll using the XD (Dynamic Explain) to create the clone 29 ©2008 BMC Software
  30. 30. BMC SQL Performance for DB2 What-if Index Analysis •With the new index the access path changes dramatically •Meanwhile the cost of the statement has gone down as well •Next step we’ll using the XD (Dynamic Explain) to create the clone • The new index has dramatically affected the access path and caused the Cost Rate for this statement to go down • More importantly, the access path went from a table space scan to a matching index access 30 ©2008 BMC Software
  31. 31. Workload Compare (new in v6r2) › Access paths can change due to: – Reorg/RUNSTATs – Application migration from test to prod – New Indexes – DSNZPARM changes (e.g. Buffer/EDM Pool) – Changes to DBMS, OS, and hardware › Compare can identify changes and analyze impact – Compare full app between 2 DB2s (across versions) – Predict changes before changes move to prod – Predict changes due to system modifications – Predict access path for dynamic SQL – Selective REBIND (to avoid letting bad paths through) – Selective BIND REPLACE (don’t BIND if no SQL change) 31 ©2008 BMC Software
  32. 32. BMC SQL Performance for DB2 6.2 Workload Access Path Compare Feature DBRMLIB DB2A SYSSTMT EXTRACT & DB2A SYSPACKSTMT EXPLAIN DB2B PLAN_TABLE Trace PLAN_TABLE Trace Archive Data Data Trace EXPLAIN OBJECT_FILE SetData Set Sets PATH_FILE SQLTXT_FILE COMPARE & COMPARE_FILE REPORT Compare static and dynamic statement access paths over time across systems, across DB2 releases 32 ©2008 BMC Software
  33. 33. BMC SQL Performance for DB2 6.2 Workload Access Path Compare Reporting › Online or batch reporting options › Unique statement compare process identifies matching statements even if statement numbers are different › Identifies potential reasons for difference in cost Report shows cost changes between different workloads • for dynamic workloads factors in # of executions • Shows categories where characteristics are different (PATH, STATS, INDEX) Multiple levels of detail Report formats are modifiable for online and batch 33 ©2008 BMC Software
  34. 34. New Performance Advisor Technology › Many types of data collected by BMC SQL Performance for DB2 can be maintained historically in DB2 tables as part of the performance database. › Infrastructure has been created to support populating and maintaining these tables. › These tables can be used for analysis and trend reporting. › The first Performance Advisor solution is provided: a REORG recommendation process that uses performance data to help decide when REORGs are needed. 34 ©2008 BMC Software
  35. 35. Performance Management Database (PMDB) › “Performance Management Databases (PMDBs) will emerge in the next five years as a second point of data-level integration. This isn’t an alternative to a Configuration Management Database (CMDB), which focuses on the configuration of an IT service for change impact. Rather, it is an additional management database that focuses on managing data needed for the performance management workflow cycle, which will require federation and reconciliation.” Moreover, “A PMDB must be able to provide data for the entire performance management workflow cycle— real- time analytics, historical data analysis, long-term capacity planning and performance tuning.” › Source: Gartner, Inc “Expect Performance Management Databases in the Future”, M. Govekar, W. Cappelli, D. Williams, February 2008 35 ©2008 BMC Software
  36. 36. Performance Advisor Concept – Manage DB2 Performance › Turn data into information, course corrections Trace Automated Trend reports Trace Data Recommendations Analysis Corrective Data Set DB2 Actions notices/alerts Set Service Performance Stats, Events Level Management Performance Database (PMDB) Management Catlg Sys/acct RTS stats stats Object Statistics DB2 Subsystem SQL Workload Stmt Object Stmt/obj Access Path Stats/acctng stats stats stats Stats Data Merge/Rollup Wrkld Reorg Index stats Cndts usage 36 ©2008 BMC Software
  37. 37. Performance Advisor: REORG Overview › REORG only the objects that are disorganized AND show degraded performance since last REORG › REORG of object with large percentage of random (SYNC) I/O won’t benefit – why waste the time & resources? › Two primary criteria – Physical disorganization of object (RTS) – Performance characteristics of object (APPTUNE) › Analysis produces a table of pagesets with a column for REORG_Candidate (Y/N) 37 ©2008 BMC Software
  38. 38. REORG Analysis Details › Three source tables – DAILY_OBJ_STATISTICS – BMCTABLESPACESTATS – BMCINDEXSPACESTATS › Two criteria – Physical disorganization of object • Table spaces: FARINDREF, REORGUNCLUSTINS as percentage of total rows • Indexes: LEAFFAR as a percentage of total leaves (DB2 9) • Indexes: LEAFFAR as a percentage of LEAFNEAR (DB2 v8) – Performance characteristics of object • Limit to objects that showed Asynchronous IO just last REORG • Synchronous IO increase since last REORG • Getpages per Synchronous IO decrease since last REORG › End result: recommend for REORG only the objects that are disorganized AND show degraded performance since last REORG 38 ©2008 BMC Software
  39. 39. Integration with BMC DASD MANAGER › Seamless integration for customers using BMC DASD Manager to control the REORG process – Object set provided by Performance Advisor technology is sent to BMCTRIG – BMCTRIG may force exceptions to REORG all objects in object set – BMCTRIG may perform additional evaluation to reorg only some objects › Cheapest REORG is the one you don’t run because it would not benefit your applications 39 ©2008 BMC Software
  40. 40. BMC SQL Performance for DB2 The Value Proposition › Manages SQL performance across the application lifecycle › Identifies poorly performing SQL statements to: – Reduce CPU cost – Improve response times – Validates SQL syntax and identifies access path selection problems – Supports the promotion process by identifying changes that will negatively impact performance as application changes are migrated – Comprehensive Explain function with what-if analysis capabilities › Performance Metrics – Captures detailed SQL performance details and object access information – Extensive filtering capabilities that reduce cost of monitoring – Online and batch reporting 40 ©2008 BMC Software
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×