Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

need to remove duplicate rows from a table

User_KWXZ9Aug 21 2013 — edited Aug 21 2013

Hi Gurus ,

I am using oracle 11.2.0.3 .

SQL> desc osstage.S_EVT_ACT_X;

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

ROW_ID                                    NOT NULL VARCHAR2(15 CHAR)

LAST_UPD                                  NOT NULL DATE

PAR_ROW_ID                                NOT NULL VARCHAR2(15 CHAR)

ATTRIB_17                                          NUMBER(22,7)

ATTRIB_26                                          DATE

ATTRIB_02                                          VARCHAR2(100 CHAR)

PROCESS_TIMESTAMP                                  TIMESTAMP(6);

now when i give the below command it gives the error as someone has disabled the constraint accidently .

alter table s_evt_act_x enable constraint S_EVT_ACT_X_P1;

Error starting at line 3 in command:

alter table s_evt_act_x enable constraint S_EVT_ACT_X_P1

Error report:

SQL Error: ORA-02437: cannot validate (OSSTAGE.S_EVT_ACT_X_P1) - primary key violated

02437. 00000 -  "cannot validate (%s.%s) - primary key violated"

*Cause:    attempted to validate a primary key with duplicate values or null

           values.

*Action:   remove the duplicates and null values before enabling a primary

           key.

Can you please guide me with this issue .

This post has been answered by AbuFazal on Aug 21 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2013
Added on Aug 21 2013
5 comments
321 views