How to create unique constraint on a column with duplicate values,without disturbing the existing data.i have already tried the method below,
To create a normal index first and then create a unique constraint.
But in this I won't be able to drop the unused index created first.i don't want that .
Any other clean methods which can be applied in production env?
Best Answer
I'm sure this has already been asked before, but .. from the Oracle documentation
Further down the page, when you look for what each constraint state is:
So you would want to specify at the end of the constraint that it is ENABLE NOVALIDATE. Here is an example
Apparently this alone will still throw an ORA-2299 because Oracle is still attempting to back the
UNIQUE
constraint with aUNIQUE
index upon creation. The most simple way to get around that is to create the (non unique) index first.