Cheeky Cockatoo

Life Advice and Stories, Travel, Oracle Tech, Good Food and More

index_ratios.sql

Download Script

set pages 1000
col owner for a10
col index_name for a30
col table_name for a20
col ratio for 999.9
col ind_size for 9999.99
select i.owner, i.index_name, i.table_name, (s.bytes/s2.bytes)*100 ratio,
       s.bytes/1024/1024 ind_size
from dba_indexes i, dba_segments s, dba_segments s2
where i.index_name=s.segment_name
and   i.table_name = s2.segment_name
and   i.owner not in ('SYS','SYSTEM')
order by ind_size, ratio ;