BC remote Oracle DBA - Call (800) 766-1884  
Oracle Consulting Oracle Training Development

Remote DBA

Remote DBA Plans  

Remote DBA Service

Remote DBA RAC

   
Remote DBA Oracle Home
Remote DBA Oracle Training
Remote DBA SQL Tuning Consulting
Remote DBA Oracle Tuning Consulting
Remote DBA Data Warehouse Consulting
Remote DBA Oracle Project Management
Remote DBA Oracle Security Assessment
Remote DBA Unix Consulting
Burleson Books
Burleson Articles
Burleson Web Courses
Burleson Qualifications
Oracle Links
Remote DBA Oracle Monitoring
Remote DBA Support Benefits
Remote DBA Plans & Prices
Our Automation Strategy
What We Monitor
Oracle Apps Support
Print Our Brochure
Contact Us (e-mail)
Oracle Job Opportunities
Oracle Consulting Prices





   

 

 

 

Remote DBA services

Remote DBA Support

Remote DBA RAC

Remote DBA Reasons

Remote Oracle Tuning

Remote DBA Links

Oracle DBA Support

Oracle DBA Forum

Oracle Disaster

Oracle Training

Oracle Tuning

Oracle Training

 Remote DBA SQL Server

Remote MSSQL Consulting

Oracle DBA Hosting

Oracle License Negotiation

 

 


 

 

 

 

 

 
 

Determining when to rebuild indexes

Oracle Tips by Burleson Consulting

The Data Warehouse Development Life Cycle

Oracle Features for the Data Warehouse

Determining when to rebuild indexes

So, how do we tell when an index would benefit from being rebuilt?  There are two Oracle views that provide index statistics, Remote DBA_INDEXES and INDEX_STATS.  The Remote DBA_INDEX view contains statistical information that is placed into the view when the ANALYZE INDEX xxx command is issued.  Unfortunately, the Remote DBA_INDEXES view was designed to provide information to the cost-based SQL optimizer and it does not keep statistics about the internal status of the Oracle indexes.  To see the internal structure for an Oracle index, you must use the ANALYZE INDEX xxx VALIDATE STRUCTURE  SQL command to validate the structure for the index.  This command creates a single row in a view called INDEX_STATS.

 

SQL> analyze index DON.DON_FK_PLT validate structure;

 

Index analyzed.

 

SQL> select * from index_stats;

 

    HEIGHT     BLOCKS NAME                              LF_ROWS    LF_BLKS
---------- ---------- ------------------------------ ---------- ----------
LF_ROWS_LEN LF_BLK_LEN    BR_ROWS    BR_BLKS BR_ROWS_LEN BR_BLK_LEN DEL_LF_ROWS
----------- ---------- ---------- ---------- ----------- ---------- -----------
DEL_LF_ROWS_LEN DISTINCT_KEYS MOST_REPEATED_KEY BTREE_SPACE USED_SPACE
--------------- ------------- ----------------- ----------- ----------
  PCT_USED ROWS_PER_KEY BLKS_GETS_PER_ACCESS
---------- ------------ --------------------
         3       5635 DON_FK_PART                       196103       2382
    3137648       3900       2381         18       41031       3956           7
            112           125             56220     9361008    3178679
        34     1568.824              787.912

The Oracle index_stats view will never contain more than one row.  Therefore, you must
perform the "analyze index xxx validate structure" command and "select * from index_stats" before issuing the next analyze index command.  The script id1.sql provides a method for getting a complete report for all indexes.


This is an excerpt from "High Performance Data Warehousing". To learn more about Oracle, try "Oracle Tuning: The Definitive Reference", by Donald K. Burleson.  You can buy it direct from the publisher at 30% off here:
http://www.rampant-books.com/book_1002_oracle_tuning_definitive_reference_2nd_ed.htm
 

 


Expert Remote DBA

BC is America's oldest and largest Remote DBA Oracle support provider.  Get real Remote DBA experts, call
BC Remote DBA today.

 

 

Remote DBA Service
 

Oracle Tuning Book

 

Advance SQL Tuning Book 

BC Oracle support

Oracle books by Rampant

Oracle monitoring software

 

 

 

 

 

 

BC Remote Oracle Support

Remote DBA

Remote DBA Services

Copyright © 1996 -  2013 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.