Oracle Index Usage Report
This script displays usage information for indexes on a specified table. It queries the V$OBJECT_USAGE view to show whether indexes were used during monitoring, along with monitoring start and end times, helping DBAs identify unused indexes and improve performance tuning decisions.
oraclesqlindexing-statisticsv1.0.0
0 stars0 downloads17 views0 comments
By OracleDba • Created
Code
(18 lines)123456789101112131415161718
-- -----------------------------------------------------------------------------------
-- File Name : https://oracle-base.com/dba/monitoring/index_usage.sql
-- Author : Tim Hall
-- Description : Shows the usage for the specified table indexes.
-- Call Syntax : @index_usage (table-name) (index-name or all)
-- Last Modified: 04/02/2005
-- -----------------------------------------------------------------------------------
SET VERIFY OFF
SET LINESIZE 200
SELECT table_name,
index_name,
used,
start_monitoring,
end_monitoring
FROM v$object_usage
WHERE table_name = UPPER('&1')
AND index_name = DECODE(UPPER('&2'), 'ALL', index_name, UPPER('&2'));