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

 

 


 

 

 

 

 

 
 

Oracle Tips 

by Burleson Consulting

The Data Warehouse Development Life Cycle

Oracle Features for the Data Warehouse


How to create a clustered index

Listing 8.2   A SQL*Plus routine to locate clustered indexes 

rem idx_bad1.sql, © 1997 by Donald K. Burleson
set pagesize 60;
set linesize 100;
 
column c0 heading 'Table'      format a8;
column c1 heading 'Index'      format a18;
column c2 heading 'Level'      format 999;
column c3 heading 'Clust Ftr'  format 9,999,999;
column c4 heading '# rows'     format 99,999,999;
column c5 heading 'Clust Pct'  format 999.9999;
column c6 heading 'dist. Keys' format 99,999,999;
 
spool idx_bad1.lst;
 
break on c0 skip 1;
 
select
  Remote DBA_indexes.table_name                            c0,
  index_name                                        c1,
  blevel                                            c2,
  clustering_factor                                 c3,
  num_rows                                          c4,
  decode(clustering_factor,0,1,clustering_factor)/
  decode(num_rows,0,1,num_rows)                     c5,
  distinct_keys                                     c6
from Remote DBA_indexes, Remote DBA_tables
SEE CODE DEPOT FOR FULL SCRIPT
and c5 < .25
order by c0, c5 desc;
 
spool off;

 
Here is a sample listing from this report:

SQL> @idx_bad1

Table    Index               Level Clust Ftr      # rows     reorg  dist. Keys
-------- ------------        ----- ---------- ----------   -------  ----------
INV_LINE INV_LINE_ITEM_PK       2     62,107   1,910,034     .0325   1,912,644
         ILI_FK_INV             2    164,757   1,910,034     .0339   1,659,625
         ILI_FK_ACT             2    283,343   1,910,034     .0436          47
         ILI_EK_CCHS_ACCT       3  1,276,987   1,910,034     .1450      25,041
 
Now, let’s inspect this listing to see the clustering status of our indexes.  The indexes are listed within each table heading in descending order of their clustering factor, with the most clustered indexes at the bottom of the list.  In the example above we see the INV_LINE_ITEM_PK index with a clustering factor of 62,107, indicating that the INV_LINE table has been loaded in nearly the same physical order as this index.

If the value for clustering factor approaches the number of blocks in the base table, then the index is said to be clustered.  If the clustering factor is greater than the number of blocks in the base table and approaches the number of rows in the base table, then the index is un-clustered.


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.