Download presentation
Presentation is loading. Please wait.
Published byBrian Kelley Modified over 9 years ago
1
SQL/Monitoring Facility An execution-time monitor for DB2/VM and DB2/VSE © 2008 – 2014 Software Product Research
2
SQL/MF components FThe System Monitor provides monitoring at the database level. At a defined interval, the system monitor takes a “snapshot" of database resource usage and stores the results in DB2 tables. FThe Statement Monitor monitors the databases at the SQL statement level, by recording the execution characteristics of every SQL statement submitted to the DB2 server. FThe Governor controls DB2 resource consumption by users and packages. FThe AutoPrep facility optimizes the use of dynamic SQL statements. In a relational database, access to the data is determined by the database manager. Inefficient access paths may result if SQL statements are poorly coded. Therefore, monitoring at the SQL statement level is essential.
3
SQL/Monitoring Facility Product Highlights Statement monitoring Fmonitors all running SQL statements with unprecedented detail Fsaves the runtime statistics for every SQL statement executed Flogs poorly performing statements in an exception table Fprovides application recording and benchmarking services Fissues real time alerts when performance problems are detected Fthe Governor function monitors DB2 clients for resource usage and terminates users that violate defined resource limits Fthe AutoPrep facility automatically replaces frequently used dynamic SQL statements with prepped access System Monitoring performs database-wide measurements for the DB2 subsystems: Finterpreter (RDS) FI/O manager (DBSS) Fdata spaces Flock manager Fcheckpoint agent
4
SQL/Monitoring Facility Running Statement List FThe running statement list shows all SQL statements executing in all monitored databases. FThe list is ordered by database and descending SQL cost. FStatements with an excessive SQL cost are highlighted.
5
SQL/Monitoring Facility Running Statement Detail FDetail is available for all statements in the “running” list. FThe detail screen shows: l the agent state l all run-time statistics l the statement text of all dynamic and static statements (with the actual value of the host variables) l the DB2 access path l actions allowed from the detail screen
6
SQL/Monitoring Facility Running Statements (Graphical Mode) SQLPULSE detail SQLPULSE
7
SQL/Monitoring Facility Exception Logging FAn installation may define a number of exception criteria in the SQL/MF configuration file. FWhen an SQL statement exceeds one of these exception limits during its execution, it is recorded in the SQL/MF Exception table. FException criteria can be specified as: l a maximum number of I/O requests l a maximum response time l a maximum lock wait time l a maximum idle time l a defined range of SQLCODEs a "lock escalate" event etc..
8
SQL/Monitoring Facility Statement Statistics FWhen an SQL statement completes execution, SQL/MF stores all statistics recorded for the statement in its SQL_STATEMENTS table. FThis table records: l the text of the statement l the statement’s access path l the runtime statistics for the last execution FBy consulting this table, the DBA can always obtain the monitor information for the last execution of every SQL statement.
9
SQL/Monitoring Facility Statement Recorder FThe SQL/MF Recorder notes into the Recorder file: l all SQL statements with all execution details l all DB2 checkpoints l all DB2 lockwait events FThe Recorder can be enabled: l for designated users or packages l for all users during a specified period FTo achieve acceptable performance, recording uses data spaces. Recorder List Recorder Detail
10
SQL/Monitoring Facility Statement Analysis FEvery SQL statement captured by the monitor can be forwarded to the Analysis facility. FThe facility performs a DB2 EXPLAIN for the statement and formats the EXPLAIN output into an easily readable analysis report. FThen, the facility analyzes the statement’s predicate and verifies it against all performance rules documented by IBM in the “DB2 Performance Tuning” manual. FWhen necessary, warning messages are inserted into the analysis report.
11
SQL/Monitoring Facility Notification Facility Upon request, the notification facility will alert a designated user when: Fan SQL statement performs more than a defined number of buffer lookups or I/O requests Fan SQL statement exceeds a defined response time Fa user session is idle for a defined period Fan SQL statement is in the lockwait state for a defined period Fa dynamic SQL statement exceeds a defined SQL cost NOTIFY BUFLOOK n NOTIFY TOTIO n NOTIFY RESPTIME n NOTIFY IDLETIME n NOTIFY LOCKTIME n NOTIFY DYN_COST n
12
SQL/Monitoring Facility Governor Facility The Governor is a database-wide facility that prevents uncontrolled resource consumption by users and packages. When defined resource limits are exceeded, the Governor forces the user off the database. Resource maximums can be defined for: FI/O rate Flockhold time Fstatement response time Fidle time Fdynamic SQL statement cost INCLUDE / EXCLUDE statements define the users or packages subject to a particular restriction. The following restriction will prevent ISQL users to perform more than 1000 I/O’s in one LUW MAX_IO 1000 INCLUDE PROGRAM ARIISQL
13
SQL/Monitoring Facility AutoPrep Facility The purpose of the AutoPrep facility is to reduce the cost of dynamic SQL statements. Dynamic SQL implies that DB2 determines the access strategy before every execution of the dynamic SQL. However, access path determination is a costly process in terms of CPU usage and catalog contention. Today, with increased PC database access, e-business and ERP applications, dynamic SQL tends to become a performance bottleneck. AutoPrep offers a solution by: Fdetecting frequently executed dynamic SQL commands Finitiating a DB2 prep for these commands (in the AutoPrep server) Freplacing the dynamic sequence with a static one that invokes the generated package The solution completely avoids path determination and its associated cost. Benchmarks have shown that AutoPrep reduces CPU usage during dynamic SQL with a factor 3 to 5.
14
SQL/Monitoring Facility System Monitor FThe SQL/MF System Monitor records the global performance of DB2 databases. FThe component runs in a dedicated virtual machine and inspects all monitored databases at an installation defined sampling interval. The sampled results are saved in the System Monitor tables. FMonitoring is performed for several aspects (classes) of database performance: FSystem Class FDataspaces Class FBuffer Pool Class FPackage Class FDBspace Class FStorage Pool Class FLog Class FAgent Class FLockwait Class FConnections Class FCheckpoint Class
15
For more information please visit: www.sprdb2.com
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.