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

Free Oracle Tips

HTML Text

 Home
 E-mail Us
 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   


 

 

 


 

 

 

 
 

dbms_stats.gather_fixed_objects_stats tips

Oracle Tips by Burleson Consulting

 

Starting in Oracle 10g we see a new package gather_fixed_stats for analyzing the dictionary fixed structures (the X$ tables).  We now have three types of stats to analyze for the SQL optimizer:

  • Table/object/schema stats: Via dbms_stats.gather_table_stats. Or gather_schema_stats.  Traditional metadata from data tables.

  • System stats:  Via dbms_stats.gather_system_stats:  OS statistics (disk, CPU timings).

  • Dictionary objects:  Used to make dictionary queries more efficient.  The gather_fixed_objects_stats collects the same metadata as gather_table_stats, excepts for the number of blocks.  This is because the x$ structures and the v$ views only exists in the RAM of the SGA.

The docs note "Analyze fixed objects only once, unless the workload footprint changes. You must be connected a SYS (or a user with SYSDBA) to invoke dbms_stats.gather_fixed_objects_stats.

 

Just like the workload statistics, Oracle recommends that you analyze the x$ tables only once, and during a typical database workload.

exec dbms_stats.gather_schema_stats(’SYS’,gather_fixed=>TRUE)

 

exec dbms_stats.gather_fixed_objects_stats(’ALL’);

Oracle notes that the data dictionary now contains several classes of x$ structures and v$ views:  See here for all important v$ views.

 

  • Structural fixed data - for example, v$datafile, v$datafile_header, &c

v$archive_dest
v$archive_dest_status
v$archive_gap
v$archive_processes
v$archived_log
v$bh
v$buffer_pool
v$buffer_pool_statistics
v$controlfile
v$controlfile_record_section
v$database
v$datafile
v$datafile_header
v$dataguard_status

  • Session based fixed data - Such as v$session, v$access, &c.

v$session
v$session_event
v$session_longops
v$session_wait
v$session_wait_history
v$sessmetric
v$sesstat

  • Workload fixed data - Such as  v$sql, v$sql_plan

  • SQL data:

v$sql
v$sql_bind_capture
v$sql_bind_data
v$sql_cursor
v$sql_plan
v$sql_text_with_newlines
v$sql_workarea
v$sqlarea
v$sqltext
v$sqltext_with_newlines

 

We also see the new procedures dbms_stats.export_fixed_objects_stats and dbms_stats.import_fixed_ objects_stats for migrating production workload statistics into test and development instances.

 

Re-Analyzing fix object statistics

Oracle recommends a single analyze of data dictionary and x$ fixed structures for the cost-based optimizer, but it is not clear when it is necessary to re-analyze the v$ views and x$ structures.

If it ain't broke, don't fix it.  However, Oracle recommends that major parameter changes (db_cache_size, shared_pool_size. sga_target, &c ) may be followed-up with a re-analyze using dbms_stats.gather_fixed_stats.

 

gather_fixed_objects_stats usage tips

  • You must have the SYSDBA or ANALYZE ANY DICTIONARY system privilege to execute this procedure.
     

  • Also note Bug 3982803 - OERI[kcbshcb_1] with DBMS_STATS.GATHER_FIXED_OBJECTS_STATS
     

  • Andrew Holdsworth of Oracle Corporation notes that dbms_stats is essential to good SQL performance, and it should always be used before adjusting any of the Oracle optimizer initialization parameters:

“The payback from good statistics management and execution plans will exceed any benefit of init.ora tuning by orders of magnitude”

If you like Oracle tuning, see the book "Oracle Tuning: The Definitive Reference", with 950 pages of tuning tips and scripts. 

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


 

 

  
 

 
 
 
 
Oracle performance tuning software
 
 

 

 
 
 
Oracle performance Tuning 10g reference poster
 
 
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books
 

 

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 -  2011 by Burleson Enterprises

All rights reserved.

Oracle © is the registered trademark of Oracle Corporation.