Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2010 IBM Corporation Information Management Using Snapshot monitor SQL Administrative Views for Performance Analysis on V10.1 Anthony Reina - Accelerated.

Similar presentations


Presentation on theme: "© 2010 IBM Corporation Information Management Using Snapshot monitor SQL Administrative Views for Performance Analysis on V10.1 Anthony Reina - Accelerated."— Presentation transcript:

1 © 2010 IBM Corporation Information Management Using Snapshot monitor SQL Administrative Views for Performance Analysis on V10.1 Anthony Reina - Accelerated Value Specialist aereina@ca.ibm.com

2 © 2010 IBM Corporation Information Management 2 The IBM Software Accelerated Value Program delivers a proactive, cost-reducing, and productivity enhancing advisory service. The program pairs you with an assigned team who build a foundational understanding of your overall environment. Through that understanding, the trusted partner works to facilitate faster deployment, lifecycle leadership, risk mitigation, and more by identifying ways to improve your environment, staff skill set, and processes. http://www-01.ibm.com/software/support/acceleratedvalue/ IBM Software Accelerated Value Program

3 © 2010 IBM Corporation Information Management 3 AGENDA  Introduction  Snapshot Administrative Views  Usage/Example

4 © 2010 IBM Corporation Information Management 4 Introduction Often times we encounter situations where increase in the workload against the database starts hindering overall database performance. Although this can be caused by the environment configurations, changes to the system, resource bottleneck, or simply increase in workload. It’s very possible queries running on the database are not running optimal as expected. Different methods for identifying long running sql’s…  DB2 Snapshots (ie. Application, Dynamic, etc…)  DB2 Diagnostics (ie. db2pd, db2fodc –perf/hang)  3 rd Party Monitoring Tools  DB2 Access Plans  Snapshot Administrative Views

5 © 2010 IBM Corporation Information Management 5 Snapshot Administrative Views System Defined Provide a primary, easy to use programmatic interface. Includes a collection of…  Built-in views  Table functions  Procedures  Scalar functions for various DB2 task Can be invoked from…  SQL Based application  DB2 Command Line  Command Script DFT_MONT_STMT and DFT_MON_TIMESTAMP dbm cfg should be enabled.

6 © 2010 IBM Corporation Information Management 6 Snapshot Administrative Views APPL_PERFORMANCE displays information about the percentage of rows selected by an application. LONG_RUNNING_SQL returns SQL statements executed in the currently connected database. This can be used to verify long-running SQL statements in the database. QUERY_PREP_COST returns a list of statements with information about the time required to prepare the statement. TOP_DYNAMIC_SQL returns the top dynamic SQL statements sortable by number of executions, average execution time, number of sorts, or sorts per statement.

7 © 2010 IBM Corporation Information Management 7 Snapshot Administrative Views APPL_PERFORMANCE Column NameData TypeDescription SNAPSHOT_TIMESTAMPTIMESTAMPThe date and time the snapshot was taken. AUTHIDVARCHAR (128)Authorization ID APPL_NAMEVARCHAR (256)Application Name AGENT_IDBIGINTAgent ID / Application Handle PERCENT_ROWS_SELECTEDDECIMAL (5,2)The percent of rows read from disk that were actually returned to the application. DBPARTITIONNUMSMALLINTThe database partition from which the data was retrieved for this row. MEMBERSMALLINTNumeric identifier for the database member from which the data was retrieved.

8 © 2010 IBM Corporation Information Management 8 Snapshot Administrative Views LONG_RUNNING_SQL Column NameData TypeDescription SNAPSHOT_TIMESTAMPTIMESTAMPThe date and time the snapshot was taken. ELAPSED_TIME_MININTEGERElapsed time of the statement in minutes. AGENT_IDBIGINTAgent ID / Application Handle APPL_NAMEVARCHAR (256)Application Name APPL_STATUSVARCHAR (22)Application Status (ie. CONNECTED, UOWEXEC, UOWWAIT, BACKUP, etc.) AUTHIDVARCHAR (128)Authorization ID INBOUND_COMM_ADDRESSVARCHAR (32)Inbound Communication Address STMT_TEXTCLOB (16 M)Statement Text DBPARTITIONNUMSMALLINTThe database partition from which the data was retrieved for this row. MEMBERSMALLINTNumeric identifier for the database member from which the data was retrieved.

9 © 2010 IBM Corporation Information Management 9 Snapshot Administrative Views QUERY_PREP_COST Column NameData TypeDescription SNAPSHOT_TIMESTAMPTIMESTAMPThe date and time the snapshot was taken. NUM_EXECUTIONSBIGINTThe number of times that an SQL statement has been executed. AVERAGE_EXECUTION_TIME_SBIGINTAverage execution time in seconds. AVERAGE_EXECUTION_TIME_MSBIGINTAverage execution time in – fractional, in seconds PREP_TIME_MSBIGINTThe longest amount of time in microseconds that was required to prepare a specific SQL statement. PREP_TIME_PERCENTDECIMAL (5,2)Percent of execution time spent on preparation. STMT_TEXTCLOB (16 M)Statement Text DBPARTITIONNUMSMALLINTThe database partition from which the data was retrieved for this row. MEMBERSMALLINTNumeric identifier for the database member from which the data was retrieved.

10 © 2010 IBM Corporation Information Management 10 Snapshot Administrative Views TOP_DYNAMIC_SQL Column NameData TypeDescription SNAPSHOT_TIMESTAMPTIMESTAMPThe date and time the snapshot was taken. NUM_EXECUTIONSBIGINTThe number of times that an SQL statement has been executed. AVERAGE_EXECUTION_TIME_SBIGINTAverage execution time in seconds. STMT_SORTSBIGINTThe total number of times that a set of data SORTS_PER_EXECUTIONBIGINTNumber of sorts per statement execution. STMT_TEXTCLOB (2 M)Statement Text DBPARTITIONNUMSMALLINTThe database partition from which the data was retrieved for this row. MEMBERSMALLINTNumeric identifier for the database member from which the data was retrieved.

11 © 2010 IBM Corporation Information Management 11 Example Scenario : Two set of workload is run from the environment identified as run_wkld1 and run_wkld2. DB2 DBA, would like to identify what are the queries being run from the two workload processand identify potential SQL problems.

12 © 2010 IBM Corporation Information Management 12 Example Use APPL_PERFORMANCE to see what applications are running…

13 © 2010 IBM Corporation Information Management 13 Example APPL_PERFORMANCE view output The db2bp for AGENT_ID 75, 8, and 7 would more likely to be running SQL’s.

14 © 2010 IBM Corporation Information Management 14 Example Use LONG_RUNNING_SQL to identify longest running queries that are currently being executed…

15 © 2010 IBM Corporation Information Management 15 Example LONG_RUNNING_SQL view output 1 st data collected AGENT_ID 8 and 7 is running for 1 min. and actual query is identified.

16 © 2010 IBM Corporation Information Management 16 Example LONG_RUNNING_SQL view output 2 nd data collected AGENT_ID 8 and 7 is running for 3 min. and actual query is identified.

17 © 2010 IBM Corporation Information Management 17 Example Use QUERY_PREP_COST_TIME to determined how frequent a query is run as well as average execution time for each query…

18 © 2010 IBM Corporation Information Management 18 Example QUERY_PREP_COST view output Q1 Q2/ AGENT_ID 8 Q3 Q4 Q5/ AGENT_ID 7

19 © 2010 IBM Corporation Information Management 19 Example Use TOP_DYNAMIC_SQL to determine most frequently executed and longest-running SQL statements…

20 © 2010 IBM Corporation Information Management 20 Example TOP_DYNAMIC_SQL view output Q1 Q2/ AGENT_ID 8 Q3 Q4 Q5/ AGENT_ID 7

21 © 2010 IBM Corporation Information Management 21 Other Snapshot Admin Views BP_HITRATIO returns bufferpool hit ratios, including total, data, XDA, ratio, and index hit ratio. CONTAINER_UTILIZATION returns information about the table space containers and utilization rates. LOG_UTILIZATION returns information for the currently connected database per partition. Full list of Snapshot Admin Views

22 © 2010 IBM Corporation Information Management 22 Questions?


Download ppt "© 2010 IBM Corporation Information Management Using Snapshot monitor SQL Administrative Views for Performance Analysis on V10.1 Anthony Reina - Accelerated."

Similar presentations


Ads by Google