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 


 

 

 


 

 

 
 

How to Flush AWR Data

Expert Oracle Database Tips by Burleson Consulting

November 24, 2015

For complete detauls on managing AWR retention and flushing, see the book "Oracle Tuning: The Definitive Reference".  

Question:  :  I want to flush or change the retention for my AWR data.  How can I flush my AWR data? Is there a process for adjusting AWR retention?

Answer:  Follow the link for complete details on flushing and adjusting the retention of AWR table data.

Note:  You must purchase the extra cost Oracle performance pack and Oracle diagnostic packs to use AWR.  Else, you can use the free STATSPACK tables which provide almost the same functionality.

The MMON Oracle background process is responsible for periodically flushing the oldest AWR tables, using a LIFO queue method.  Here, we see the flush_level for an AWR installation:

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 only parameter listed in the procedures is the flush_level , which 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.

The MMON background process is responsible for removing old historical data from the AWR. The amount of retention time after which data will be removed from database is determined by the retention setting. However, data can be cleared from the AWR tables by using the dbms_workload_repository.drop_snapshot_range procedure. The starting and ending snapshots for the history to be removed from the AWR will need to be set to run the following script:

desc dbms_workload_repository

PROCEDURE DROP_SNAPSHOT_RANGE
Argument Name                  Type                 In/Out Default?
------------------------------ -------------------- ------ --------
LOW_SNAP_ID                    NUMBER               IN
HIGH_SNAP_ID                   NUMBER               IN
DBID                           NUMBER               IN     DEFAULT

 Disabling and enabling automatic AWR flushing

You can disable the AWR automatic data flushing mechanism at either the system level or disable flushing for individual tables.

For system-wide disable of AWR table flushing you can use these commands but beware that the AWR tablespace will continue to grow ad-infinitum:

alter session set events 'immediate trace name awr_flush_table_off level 99′
alter session set events 'immediate trace name awr_flush_table_off level 106′;

To return to the default of weekly flushing you can issue these commands:

alter session set events 'immediate trace name awr_flush_table_on level 99′;
alter session set events 'immediate trace name awr_flush_table_on level 106′;

If you need to disable flushing the run time statistics for an AWR workload table, you can get the underlying WRH tables with this query:

select
    table_id_kewrtb,
    table_name_kewrtb
from
    x$kewrtb
order by
    table_id_kewrtb;

Once you identify a specific table to disable flushing, you can use an ALTER SYSTEM command:

 alter system set "_awr_disabled_flush_tables"=' WRH$_IC_CLIENT_STATS'; 

 

 
Get the Complete
Oracle SQL Tuning Information 

The landmark book "Advanced Oracle SQL Tuning  The Definitive Reference"  is filled with valuable information on Oracle SQL Tuning. This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.

 

 

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 -  2016

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.


 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster