Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Duplicate Constraints
al1 wrote:
> Oracle 9i
>
> We have identified numerous duplicate constraints in our database on
> some tables, I read an article where this is related to exp and imp
> with unnamed constraints.
>
> My question is how do we identify these duplicate constraints and
> remove them without having to manually go through every single table, I
> tried the query below to identify dups, but had no luck as
> search_condition is a long data type and has restrictions and wont
> allow a group by.
>
> select count(*) , table_name , search_condition
> from sys.all_constraints
> where owner = 'XXX'
> group by table_name , search_condition
> having count(*) > 1
>
> Thx In advance
Couple your statement, above, with one looking at all_cons_columns.
-- Daniel Morgan University of Washington Puget Sound Oracle Users GroupReceived on Tue Sep 19 2006 - 18:39:58 CDT