SQL statement statistics


Job details

Name: SQL statement statistics
Platform: Oracle
Category: Performance
Description: Collects SQL statement statistics from v$sqlarea performance view (Oracle 18c and newer).
Long description: Task collects SQL statement statistics from v$sqlarea performance view (Oracle 18c and newer).
Version: 2.1
Default schedule: 30 6,11,18 * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘oracle’]/.[hasengine=‘YES’ & eighteen_and_above = ‘1′ ]

Parameters

Name Default value Description
max loop time 60 The maximum time (in seconds) the task will
max sql records 100 The maximum numbers of records
buffer gets threshold 10000000 The threshold for when the statistics will be collected.
disk reads threshold 500000 The threshold for when the statistics will be collected.
excl. cursor text DECLARE,BEGIN Cursors which includes strings defined by this parameter, are excluded from the tasks check.
logging threshold 100

Job Summary

Detection and Criteria

The job is configured to trigger based on thresholds defined for ‘buffer gets’ and ‘disk reads’. It scrutinizes SQL queries whenever they exceed these thresholds, implying that such queries are consuming a high level of system resources which could degrade the performance.

Implementation Details

Dependencies

This monitoring job has several dependencies, both intra-dependent and on other database objects:

Reporting

This job is coupled with a comprehensive report which displays the collected SQL statement statistics, providing insights categorized and sorted by various performance impacting metrics like rows processed, buffer gets, disk reads, and more. The report supports visualization which helps in easy identification of potential performance bottlenecks.

Tables Used

[Database Object]. [Description]
6. dbw_sqlhistr. History Table contains previous runs data
1. dbv_sqlarea. View for optimized data access from v$sqlarea
2. sql_statements_stat. Main object managing SQL statement stats
5. dbw_sqlhistr_seq. Sequence for ID generation in history table

This job, thus, provides critical oversight into database performance, specifically focusing on SQL execution statistics. It leverages the existing infrastructure of Oracle’s performance views and includes detailed setup to gather, persist, and report meaningful metrics to administrators, aiming to enhance operational insights and facilitate efficient database management.