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 Collection Thresholds


Oracle Tips by Burleson Consulting

STATSPACK Collection Thresholds

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. 

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.  

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 Ion tool has a GUI interface that can be used to configure STATSPACK settings.

 

Figure 5.3:  Setting up STATSPACK parameters in The Ion tool.*

 

In Oracle10g, the use of STATSPACK requires more configuration settings than with the AWR. By default, the AWR requires no DBA intervention. STATSPACK has to be configured to work properly. 

While the AWR is fully automated with regard to statistic history storage, it also allows the DBA to take new snapshots manually using the dbms_workload_repository.create_snapshot procedure:

SQL> desc dbms_workload_repository


PROCEDURE CREATE_SNAPSHOT
 Argument Name                  Type         In/Out Default?
 ------------------------------ ------------ ------ --------
 FLUSH_LEVEL                    VARCHAR2     IN     DEFAULT

FUNCTION CREATE_SNAPSHOT RETURNS NUMBER
 Argument Name                  Type         In/Out Default?
 ------------------------------ ------------ ------ --------
 FLUSH_LEVEL                    VARCHAR2     IN     DEFAULT

The single parameter, flush_level, establishes the amount of information the AWR gathers. This parameter can have either the default value of TYPICAL or a value of ALL. When the statistics level is set to ALL, the AWR gathers the maximum amount of performance data. Usually, the TYPICAL level is quite enough for performance analysis and tuning purposes. The AWR uses the SPFILE initialization parameter, statistics_level , which specifies the level for snapshots gathered by the MMON process. The possible values for this parameter are the same, TYPICAL and ALL.

The package, dbms_workload_repository , also has the overloaded function, create_snapshot, which has the same parameter level and performs the same job as create_snapshot procedure except that it only returns the number of the newly created snapshot. 

In the STATSPACK utility, the statspack.snap procedure must be executed manually as an Oracle job in order to gather history for v$ statistics on a regular basis. The statspack.snap procedure must be called to take a new STATSPACK snapshot:

SQL> desc statspack 

PROCEDURE SNAP 

 Argument Name       Type         In/Out 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 parameters for the statspack.snap procedure allow the DBA to specify the level of statistics gathered and the specific thresholds for the new snapshot. The settings specified in the call of statspack.snap procedure will be valid only for this single new snapshot. 

Another essential difference between AWR and STATSPACK is the way that old statistical history is removed from the database. The AWR removes old snapshots from its repository based on the retention parameter, which specifies the length of time that any snapshot is stored in the database. DBAs do not need to manually clear the database of old information.

SEE CODE DEPOT FOR FULL SCRIPTS


This is an excerpt from my latest book "Oracle Tuning: The Definitive Reference". 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts:

http://www.rampant-books.com/book_1002_oracle_tuning_definitive_reference_2nd_ed.htm

 


 

 

��  
 
 
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 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational