DB2 Performance & Tuning with iStrobe
Frank Schuler
Strobe MF Application Performance Management Field Technical Support
September 20, 2012
2
DB2 Performance & Tuning with iStrobe
1. Strobe & iStrobe 2. CICS Case Study 3. Batch Case Study 4. DB2 / DDF Case Study 5. Consider DB2 System Services
The Strobe Process
MeasuringMeasuring
Sample Dataset
ReportingReporting
Add Request Pgm Execution
StrobeMeasurement Strobe
Reporter
Strobe Profile
iStrobe
CPU
I/O
STROBE drills down through all the layers of your OS/390 address space to pinpoint specific areas of resource demand
Data sets
I/O Devices
I/O Subsystems
Database Management Systems
OS/390 Operating System
Database & IO Subsystems
CICS
Library Routines
UserPrograms
What Strobe Sees
CPU
I/O
STROBE drills down through all the layers of your OS/390 address space to pinpoint specific areas of resource demand
Data sets
I/O Devices
I/O Subsystems
Database Management Systems
OS/390 Operating System
Database and IO Subsystems
CICS
Library Routines
UserPrograms
What Strobe Sees
Analysis - iStrobe
• Browser-based product for• Navigating performance reports• Analyzing and improving performance
• Supplies tips for improving performance• Module HELP database supplies descriptions and
performance hints for system services• SQL Analysis Feature makes recommendations for
improving SQL performance
• iStrobe improves Strobe ease of use by providing a GUI home page look and feel for interpreting profile reporting
• Look for the biggest number or the longest line
• “Click until you click no more” (+ expands on current page)
• Jump to next report via ( Report Icon)
• 5 clicks or less to the root cause
iStrobe Automates the Strobe Profile Report Interpretation Process
Traditional Strobe Text Based Reports
iStrobe Automates Strobe Interpretation and Analysis
iStrobe – Initial Panel
CICS Case Study
12
iStrobe 4.2 – Measurement Session Data - CICS
iStrobe 4.2 – Program CPU Usage
CA Detector
iStrobe 4.2 – DB2 Activity by Query
iStrobe 4.2 – SQL Analysis
iStrobe 4.2 – DB2 Explain Expanded
iStrobe 4.2 – DB2 Catalog Statistics
Analysis Summary•XIE1RULE: 206K Rows / 5.1K Pages
•XPKCLM_Rule(1) 277K Rows / 3.2K Pages
•Non-Matching Index Scan•Consider adding an index to Table ITS.RULE to change the Non-Matching Index Scan to a Matching Index Only Scan as follows:
• Column 1 – PRFX_CD• 2 – STS_QUAL_CD• 3 – STS_CD• 4 – LOC_PLAN_CD• 5 – PLAN_PROFL_UID
•Get Pages & CPU reduced
Batch
20
iStrobe 4.2 – Measurement Session Data - Batch
iStrobe 4.2 – Program CPU Usage
CA Detector
iStrobe 4.2 – DB2 Activity by Query
iStrobe 4.2 – DB2 Explain
iStrobe 4.2 – DB2 Catalog Statistics
Analysis Summary
•ACSIS.OPEN: 259K Rows / 5.5K Pages
•There are 259,000 rows on this table but the cursor is opened nearly 5 million times. Resulting in a large number of duplicates.
•Recommend checking programmatically to see if the program will be accessing the same row(s) and not make the open again.
•Table ACSIS.OPEN. PCTROWCOMP is 0.0
• Consider turning DB2 Compression on if the NPAGES is greater than 500 and the DB2 compression utility DSN1COMP indicates the compression ratio would be greater than 30%
DDF
27
iStrobe 4.2 – Measurement Session Data - DDF
iStrobe 4.2 – DB2 Stored Procedure SQL Activity
iStrobe 4.2 – DB2 Explain
iStrobe 4.2 – DB2 Catalog Statistics
Analysis Summary•XI18S1 6.5M Rows / 303K Pg
•Non-Matching Index Scan•Consider adding an index to Table TXT18S_BILL_VALIDATION to change the Non-Matching Index Scan to a Matching Index Only Scan as follows:
•Column 1 – ACCOUNT_ID• 2 – CIRCUIT_ID• 3 – PON• 4 – USOC• 5 – JURISDICTION_CD• 6 – BILL_DATE •
•Get Pages & CPU reduced
Consider what DB2 System Services is
doing on behalf of your SQL as part of your
analysis
34
DB2Data
Relational Data System(RDS)Relational Data System(RDS)
• Checks SQL statements• Processes Stage 2 predicates• Performs sort and optimization
• Checks SQL statements• Processes Stage 2 predicates• Performs sort and optimization
Data Manager(DM)Data Manager(DM)
• Processes Stage 1 predicates• Processes indexable predicates• Interfaces with IRLM
• Processes Stage 1 predicates• Processes indexable predicates• Interfaces with IRLM
Buffer Manager(BM)Buffer Manager(BM)
• Manages bufferpools• Moves data to and from DASD• Manages bufferpools• Moves data to and from DASD
Database Services Address Space
DB2 Address Space Reporting #PUP ** PROGRAM USAGE BY PROCEDURE **
.SYSTEM SYSTEM SERVICES .DB2 DB2 SYSTEM SERVICES MODULE SECTION FUNCTION % CPU TIME MARGIN OF ERROR 6.84% NAME NAME SOLO TOTAL 00 8.00 16.00 DSNBBM DSNB1GET RETRIEVE REQUESTED PAGE 3.41 3.41 ***** DSNBBM DSNB1REL PAGE RELEASE ROUTINE .49 .49 * DSNECP10 DSNAPRH PGM REQUEST APPL INTERF 1.46 1.46 ** DSNECP10 DSNECP21 PARSE DSN COMMAND .49 .49 * DSNGEDM DATA MGT DBD/SKCT RTNS .49 .49 * DSNIDM DSNICSMP CHK MAP PAGE CONSISTENC .49 .49 * DSNIDM DSNICUBD ADD AN OBJECT TO CUB DY .49 .49 * DSNIDM DSNIMSAR RELEASE ALL MSA RESOURC 1.46 1.46 ** DSNIDM DSNINXTP READ SPECFD PAG USNG MS .49 .49 * DSNIDM DSNIOST2 SET ON CUB DEF ON IX FA .98 .98 ** DSNIDM DSNIPSBL LOC AN EXISTING PSCB .49 .49 * DSNIDM DSNIRNXT FETCH NEXT ROW TO PROG 14.15 14.15 ****************** DSNIDM DSNIRPRV TABLE SPACE SCAN BACKWA .49 .49 * DSNXGRDS RDS ACCESS MODULE GENER .32 .32(subsequent lines omitted)
Strobe will identify the DB2 services utilized by the SQL
DB2 Address Space Reporting #PUP ** PROGRAM USAGE BY PROCEDURE **
.SYSTEM SYSTEM SERVICES .DB2 DB2 SYSTEM SERVICES MODULE SECTION FUNCTION % CPU TIME MARGIN OF ERROR 6.84% NAME NAME SOLO TOTAL 00 8.00 16.00 DSNBBM DSNB1GET RETRIEVE REQUESTED PAGE 3.41 3.41 ***** DSNBBM DSNB1REL PAGE RELEASE ROUTINE .49 .49 * DSNECP10 DSNAPRH PGM REQUEST APPL INTERF 1.46 1.46 ** DSNECP10 DSNECP21 PARSE DSN COMMAND .49 .49 * DSNGEDM DATA MGT DBD/SKCT RTNS .49 .49 * DSNIDM DSNICSMP CHK MAP PAGE CONSISTENC .49 .49 * DSNIDM DSNICUBD ADD AN OBJECT TO CUB DY .49 .49 * DSNIDM DSNIMSAR RELEASE ALL MSA RESOURC 1.46 1.46 ** DSNIDM DSNINXTP READ SPECFD PAG USNG MS .49 .49 * DSNIDM DSNIOST2 SET ON CUB DEF ON IX FA .98 .98 ** DSNIDM DSNIPSBL LOC AN EXISTING PSCB .49 .49 * DSNIDM DSNIRNXT FETCH NEXT ROW TO PROG 14.15 14.15 ****************** DSNIDM DSNIRPRV TABLE SPACE SCAN BACKWA .49 .49 * DSNXGRDS RDS ACCESS MODULE GENER .32 .32(subsequent lines omitted)
Strobe will identify the DB2 services utilized by the SQL
Thank You