Indexes are usually not maintained in Oracle databases. But indexes need to be checked regularly. If an index is created and not checked, it may cause trouble. You may encounter an index that has reached a very large size in the future, spent serious db time, slowed down the processes in the table, but was not used in any query.
The use of indexes should be monitored. Unused indexes should be dropped.
When the index usage monitoring is turned on, we can find out whether the relevant index is used by the Cost Based Optimizer. This information is not sufficient to drop the index. For example, the use of primary key indexes will always be NO. Therefore, when it is dropped, it causes serious problems.
In summary, unused indexes can be dropped if they are not associated with the primary key or any sql profile.
Open Index Usage Monitoring:
SQL> ALTER INDEX INDEX_NAME MONITORING USAGE;
Once the monitor is opened, you can watch it with v $ object_usage. In addition, if you create a view as below, you will have the opportunity to examine more in detail.
CREATE VIEW dba_object_usage (owner,object_type,
index_name, table_name, monitoring, used, start_monitoring, end_monitoring )
SELECT do.owner, do.object_type, io.NAME, t.NAME,
DECODE (BITAND (i.flags, 65536), 0, 'NO', 'YES'),
DECODE (BITAND (ou.flags, 1), 0, 'NO', 'YES'), ou.start_monitoring,
FROM SYS.obj$ io,
WHERE i.obj# = ou.obj#
AND io.obj# = ou.obj#
AND t.obj# = i.bo#
AND ou.obj# = do.object_id;
I would like to point out that the monitoring of its usage will bring extra load to the system. After you are done, you can close it as follows.
Close Index Usage Monitoring:
SQL> ALTER INDEX INDEX_ADI NOMONITORING USAGE;