Saturday, June 25, 2016

Index Checking

set linesize 125
set pages 1000
col c1 hea "TABLE NAME" format a20
col c2 hea "INDEX NAME" format a20
col c3 hea "INDEX TYPE" format a10
col c4 hea "UNIQUENESS" format a10
col c5 hea "COLUMN NAME" format a15
col c6 hea "COLUMN|POSITION" format 99999999
col c7 hea "STATUS" format a10
col c8 hea "T.SPACE" format a12
col c9 hea "PRTN" format a5
break on report on c1 skip 1 on c2 on c3 on c4 on c5 on c6
select a.table_name c1,a.index_name c2,index_type c3,uniqueness
c4,column_name c5,column_position c6, status c7, tablespace_name c8,
partitioned c9
from user_ind_columns a,user_indexes b where  a.table_name=upper('&table')
and a.index_name=b.index_name order by c1,c2,c6;

No comments: