Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

STATSPACK Snapshot thresholds

Oracle Tips by Burleson Consulting
Don Burleson

STATSPACK and AWR Snapshot Thresholds

The snapshot thresholds for AWR and STATSPACK are frequently misunderstood.  In you look at the report format for any AWR or STATSPACK report, we see SQL statistics can take-up over 50% of a report.  Capturing the details of execution for SQL does not take a lot of system overhead, but the STATSPACK (perfstat.stats$sql_summary) and AWR tables  (perfstat.dba_hist_sql_summary) grow quickly. 

Unlike STATSPACK, AWR uses a "Top N" method which defaults to collect the Top-30 SQL statements for each SQL category,  If you set statistics_level = "all", AWR will collect the top 100 SQL statements.

These tables contain your SQL source code, and if you set your snapshot thresholds too generously, you could consume a gigabyte of disk in just a few months. 

One of the most common problems with STATSPACK is when the volume of data reaches the file size limit for the STATSPACK tables.

The intent of AWR and STATSPACK is that the DBA will intelligently set their thresholds, depending on the "exception threshold" for the system.  The exception threshold is determined by finding the averages for the whole application, adding a plus/minus tolerance factor.

 

 

The snapshot thresholds only apply to the SQL statements that are captured in the stats$sql_summary table. The stats$sql_summary table can easily become the largest tables in the STATSPACK schema because each snapshot might collect several hundred rows, one for each SQL statement that was in the library cache at the time of the snapshot.

In the Automatic Workload Repository (AWR), the executions_th , parse_calls_th , disk_read_th  , buffer_gets_th , sharable_mem_th , and version_count_th SQL collection threshold settings allow the DBA to set thresholds for SQL statements.  If any of the thresholds are exceeded, the information will be stored by STATSPACK in the repository.
 
The thresholds are stored in the stats$statspack_parameter table. Let's take a look at each threshold.  The names are different for different releases of STATSPACK and AWR:

Oracle 8 (backported) through Oracle8i:

?        executions_thThis is the number of executions of the SQL statement (default is 100).

?        disk_reads_thThis is the number of disk reads performed by the SQL statement (default is 1,000).

?        parse_calls_thThis is the number of parse calls performed by the SQL statement (default is 1,000).

?        buffer_gets_thThis is the number of buffer gets performed by the SQL statement (default is 10,000).

Oracle9i and beyond:

In Oracle9i and beyond STATSPACK (and the AWR thresholds), there are new threshold parameters:

p_def_num_sql - This is a threshold for the number of SQL statements.

p_def_executions_th - This is a threshold for the number of SQL executions.

p_def_parse_calls_th  - This is a threshold for the number of SQL parse calls.

p_def_disk_reads_th    - This is a threshold for the number of disk reads.

p_def_buffer_gets_th  - This is a threshold for the number of SQL buffer gets.

p_def_sharable_mem_th  - This is a threshold for the SQL sharable memory.

p_def_version_count_th   - This is a threshold for the SQL child cursors.

The above STATSPACK parameters can be set manually using the statspack.modify_statspack_parameter procedure:

 

SQL> desc statspack

 

PROCEDURE MODIFY_STATSPACK_PARAMETER

 

 Argument Name         Type          In/Out Default?

 --------------------- ------------- ------ --------

 I_DBID                NUMBER        IN     DEFAULT

 I_INSTANCE_NUMBER     NUMBER        IN     DEFAULT

 I_SNAP_LEVEL          NUMBER        IN     DEFAULT

 I_SESSION_ID          NUMBER        IN     DEFAULT

 I_UCOMMENT            VARCHAR2      IN     DEFAULT

 I_NUM_SQL             NUMBER        IN     DEFAULT

 I_EXECUTIONS_TH       NUMBER        IN     DEFAULT

 I_PARSE_CALLS_TH      NUMBER        IN     DEFAULT

 I_DISK_READS_TH       NUMBER        IN     DEFAULT

 I_BUFFER_GETS_TH      NUMBER        IN     DEFAULT

 I_SHARABLE_MEM_TH     NUMBER        IN     DEFAULT

 I_VERSION_COUNT_TH    NUMBER        IN     DEFAULT

 I_ALL_INIT            VARCHAR2      IN     DEFAULT

 I_PIN_STATSPACK       VARCHAR2      IN     DEFAULT

 I_MODIFY_PARAMETER    VARCHAR2      IN     DEFAULT

 

The executions_th , parse_calls_th , disk_read_th  , buffer_gets_th , sharable_mem_th , and version_count_th settings allow the DBA to set thresholds for SQL statements.  If any of the thresholds are exceeded, the information will be stored by STATSPACK in the repository.
 
The above STATSPACK parameters can be set manually using the statspack.modify_statspack_parameter procedure:




 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.