Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

 
 
 
 Category : Home > Databases > Oracle > Oracle 9     

How to find unused indexes


To determine if your indexes are being used or you can drop them use index monitoring (this
feature is available from Oracle 9 onwards).

1. To start index monitoring:

SQL> alter index SAMPLE_INDEX monitoring usage;

If this statement fails with
ORA-00054: resource busy and acquire with NOWAIT specified
The index is already being used, so it doesn't have to be monitored.

It depends on your application how long you want to run monitoring. Are the same queries
running every day or are there batch runs once a month etc. This will determine duration of
monitoring. 

2. To see if the index is used or not query V$OBJECT_USAGE (you have to be logged in as the
schema owner of the index):

select * from V$OBJECT_USAGE where index_name = 'SAMPLE_INDEX';

3. To stop index monitoring:

SQL> alter index SAMPLE_INDEX nomonitoring usage;

4. If you decided to drop an index make sure you save DDL just in case.


  Options
 
   del.icio.us  |  newsvine  |  digg  |  furl  |  google  |  yahoo  |  Ma.gnolia  |  vigillar  |  reddit  |  technorati  |  icerocket  |  pubsub

     (Average: 3 / Votes: 5)   Rate this tip:    

Start discussion or add comment to this tip

  Details
Tip reference : #71
views : 1144
Added on : 01/24/06
Submited by : h8dk97
 
Send a message Send a message Printer friendly output Printer friendly output
Display this member's tips Display this member's tips (149)
 
 
Next >>
 Most viewed tips 
  Databases > Oracle > Security : How to unlock Oracle user account  
  Databases > Oracle > Performance Tuning : How to enable trace in Oracle  
  Databases > Oracle : Kill user session  
  Databases > Oracle : Scripts to backup Oracle database on Windows NT  
   
  All categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Office Software | TipLib FAQ
 
 

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com