690 shaares
3 liens privés
3 liens privés
1 résultat
taggé
fk
oracle : retrouver les FK qui n'ont pas d'index (source)
select
a.owner ,a.constraint_name cons_name
,a.table_name tab_name
,b.column_name cons_column
,nvl(c.column_name,'No Index') ind_column
from all_constraints a
join
ALL_CONS_COLUMNS b on a.constraint_name = b.constraint_name
left outer join
all_ind_columns c on b.column_name = c.column_name
and b.table_name = c.table_name
where constraint_type = 'R'
and a.owner not in ('SYSTEM', 'SYS', 'DBSNMP')
order by 1,3,2;