Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

finding unused indexes

user11278505Dec 23 2009 — edited Dec 23 2009
Hi all,

I have to find unused indexes for a particular table..

I am using below script to findout and remove the unused indexes.

select
p.object_name c1,
p.operation c2,
p.options c3,
count(1) c4
from
dba_hist_sql_plan p,
dba_hist_sqlstat s
where
p.object_owner = 'NAME'
and
p.operation like ‘%INDEX%’
and
p.sql_id = s.sql_id
group by
p.object_name,
p.operation,
p.options
order by
1,2,3;

so what my question is using this output of this script can i remove the indexes which are used very less or not all used.
and also this query gets from views

dba_hist_sql_plan p,
dba_hist_sqlstat s

so may i know how many days data will be there in these views.
so the above query gets the results about index usage of how many days????

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 20 2010
Added on Dec 23 2009
10 comments
2,658 views