Hi I was inserting some date do my table. For some reasons I had to disable my constraint. The constraint was associated with index. I. ve used this line of code:
ALTER TABLE my_table DISABLE CONSTRAINT "my_constraint" drop index
And my_constraint is in disable state.
No I’ d like to enable this constraint, but after calling this line:
ALTER TABLE my_table ENABLE NOVALIDATE CONSTRAINT "my_constraint";\
I recive an error:
ORA-02299: cannot validate (USER.my_constraint) – – duplicate keys found
You cannot have non-unique values with a unique index. But you can have non-unique values with a unique constraint that is enforced by a non-unique index. Even if you initially created a non-unique index, the
drop indexandenablesyntax will try to recreate a unique index unless you provide more details in theusing indexsection.For example: