Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Q: Identify indexes which are no longer used ?
On Thu, 01 Jul 1999 21:05:43 GMT, tedchyn_at_yahoo.com wrote:
>Sir, is there a way identifying obsolete indexes which are no longer
>used ?
Beside the method suggested by Jonathan Lewis, another way to find this would be to periodically check the SYS.V$BH view for any block of the suspected index being in the buffer cache. Something like:
SELECT COUNT(*) FROM v$bh b, dba_extents e
WHERE b.file# = e.file_id AND b.block# BETWEEN e.block_id AND (e.block_id+e.blocks) AND e.owner = '&index_owner' AND e.segment_name = '&index_name';
This query could be set to execute periodically and insert the result into a separate table. The interval should depend on the activity of the database, or in other words, how frequently are the rarely used index blocks flushed out of the buffer cache.
Of course, this brings an overhead to the normal database operations, so if the performance of the application is of primary concern then I wouldn't run this query too often.
Note also that V$BH might not exist on your database. If so, run the script CATPARR.SQL, which will create it. Although this script is intended for parallel server environments, there is no harm if you run it on your single instance database.
>thaks in inadvance (tedcyn_at_yahoo.com)
HTH,
Jurij Modic <jmodic_at_src.si>
Certified Oracle DBA (7.3 & 8.0 OCP)
![]() |
![]() |