/* ************************************************ */
/*                                                  */
/* fnctn:   Script for ALL_INDEXES from index       */
/*          statistics                              */
/*                                                  */
/* name:    @c:\oracle\sql\idx_stat.sql             */
/* date:    12-MAY-95                               */
/* creator: Rick Kupcunas (Oracle)                  */
/*                                                  */
/* ************************************************ */

 accept iname prompt 'Please enter the index name you wish to report
                     statistics on:' ;
 prompt
  
 col status            format a12     heading '*STATUS*'
 col index_name        format a12     heading 'INDEXNAME'
 col table_name        format a12     heading 'TABLENAME'
 col blevel            format 9       heading 'TREELEVEL'
 col leaf_blocks       format 9999    heading 'LEAFBLOCKS'
 col distinct_keys     format 9999999   
 col clustering_factor format 9999999 heading 'ORDERED_ROWS'  
  
  select status, 
         index_name,
         table_name,
         blevel,
         leaf_blocks,
         distinct_keys,
         clustering_factor
   from sys.all_indexes
     where index_name = '&index_name'

undefine index_name;
commit;