Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6762965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:25:15+00:00 2026-05-26T14:25:15+00:00

Hi I was inserting some date do my table. For some reasons I had

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:25:16+00:00Added an answer on May 26, 2026 at 2:25 pm

    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 index and enable syntax will try to recreate a unique index unless you provide more details in the using index section.

    For example:

    SQL> create table my_table(my_column number,
      2     constraint my_constraint unique (my_column));
    
    Table created.
    
    SQL> alter table my_table disable constraint my_constraint drop index;
    
    Table altered.
    
    SQL> insert into my_table select 1 from dual union all select 1 from dual;
    
    2 rows created.
    
    SQL> alter table my_table enable novalidate constraint my_constraint;
    alter table my_table enable novalidate constraint my_constraint
    *
    ERROR at line 1:
    ORA-02299: cannot validate (USER.MY_CONSTRAINT) - duplicate keys found
    
    
    SQL> alter table my_table enable novalidate constraint my_constraint
      2     using index (create index my_index on my_table(my_column));
    
    Table altered.
    
    SQL> --The constraint is enforced, even though other rows violate it.
    SQL> insert into my_table values(1);
    insert into my_table values(1)
    *
    ERROR at line 1:
    ORA-00001: unique constraint (USER.MY_CONSTRAINT) violated
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am dynamcially naming temporary table, inserting some data to this dynamic-named temporary table.
i have some SQL code that is inserting values from another (non sql-based) system.
i am looking at some practice questions Assume that you've just created this table:
After inserting new data into a table, I need to select some of the
After inserting new html to DOM,I need to add some listeners to it. But
I am writing a prototype application. Right now some things fail such as inserting
I'm working on a online game. I got some problems with inserting new data
After inheriting some Zend Framework code it didn't work, after lots of fiddling I've
I am loading some data into a temp table. I then use a cursor
I was using phpmyadmin to insert some dummy data into a table, and noticed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.