Assuming your primary key is indeed defined in this column and is included, you can check if it is verified. Only verified constraints are guaranteed by Oracle as true for all rows.
Here's a script with an incomplete primary key with a duplicate value:
SQL> DROP TABLE t; Table dropped SQL> CREATE TABLE t (ID NUMBER); Table created SQL> INSERT INTO t VALUES (1); 1 row inserted SQL> INSERT INTO t VALUES (1); 1 row inserted SQL> CREATE INDEX t_id_idx ON t(ID); Index created SQL> ALTER TABLE t ADD CONSTRAINT pk_id PRIMARY KEY (ID) NOVALIDATE; Table altered SQL> SELECT * FROM t; ID ---------- 1 1 SQL> SELECT constraint_type, status, validated 2 FROM user_constraints 3 WHERE constraint_name = 'PK_ID'; CONSTRAINT_TYPE STATUS VALIDATED --------------- -------- ------------- P ENABLED NOT VALIDATED
Update:
One likely explanation is that loading the direct path (from SQL * Loader) left your unique index in an unusable state with duplicate primary keys.
source share