Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-11-27 · container image gvenzl/oracle-free:23-slim
ORA-02443 appears when ALTER TABLE ... DROP CONSTRAINT names a constraint that the table does not have. The constraint may have a different name, belong to another table, or already be gone.
Below are three common cases reproduced on a real database, with the fix we ran and its result.
01The constraint was created without a name, so Oracle named it SYS_C...
users was created with email VARCHAR2(100) UNIQUE, without a constraint name. ALTER TABLE users DROP CONSTRAINT users_email_uk failed with ORA-02443, because no constraint had that name.
Joining user_constraints and user_cons_columns showed SYS_C009206 U EMAIL: Oracle had given it a system name. We looked up the name by column in a PL/SQL block and dropped it with EXECUTE IMMEDIATE. It printed dropped unique constraint on EMAIL, and the table had 0 unique constraints left.
Setup
CREATE TABLE users (user_id NUMBER PRIMARY KEY, email VARCHAR2(100) UNIQUE);Table created.ALTER TABLE users DROP CONSTRAINT users_email_uk;ALTER TABLE users DROP CONSTRAINT users_email_uk
*
ERROR at line 1:
ORA-02443: Cannot drop constraint - nonexistent constraint
Help: https://docs.oracle.com/error-help/db/ora-02443/COLUMN constraint_name FORMAT A14
COLUMN column_name FORMAT A8
SELECT c.constraint_name, c.constraint_type, cc.column_name FROM user_constraints c JOIN user_cons_columns cc ON cc.constraint_name = c.constraint_name WHERE c.table_name = 'USERS' AND c.constraint_type = 'U';CONSTRAINT_NAM C COLUMN_N
-------------- - --------
SYS_C009206 U EMAIL
1 row selected.SYS_C numbers differ per database, so do not hard-code them in scripts. Naming constraints when you create them avoids this.
SET SERVEROUTPUT ON
DECLARE
v_name user_constraints.constraint_name%TYPE;
BEGIN
SELECT c.constraint_name INTO v_name
FROM user_constraints c JOIN user_cons_columns cc ON cc.constraint_name = c.constraint_name
WHERE c.table_name = 'USERS' AND c.constraint_type = 'U' AND cc.column_name = 'EMAIL';
EXECUTE IMMEDIATE 'ALTER TABLE users DROP CONSTRAINT ' || v_name;
DBMS_OUTPUT.PUT_LINE('dropped unique constraint on EMAIL');
END;
/
SELECT COUNT(*) AS unique_constraints FROM user_constraints WHERE table_name = 'USERS' AND constraint_type = 'U';dropped unique constraint on EMAIL
PL/SQL procedure successfully completed.
UNIQUE_CONSTRAINTS
------------------
0
1 row selected.02A foreign key was dropped from the parent table instead of the child
emp.dept_id had CONSTRAINT emp_dept_fk REFERENCES dept. Running ALTER TABLE dept DROP CONSTRAINT emp_dept_fk failed with ORA-02443.
user_constraints showed EMP_DEPT_FK R EMP DEPT_PK: the foreign key belongs to the child table EMP, not to DEPT. ALTER TABLE emp DROP CONSTRAINT emp_dept_fk succeeded.
Setup
CREATE TABLE dept (dept_id NUMBER CONSTRAINT dept_pk PRIMARY KEY, name VARCHAR2(30));
CREATE TABLE emp (emp_id NUMBER PRIMARY KEY, dept_id NUMBER CONSTRAINT emp_dept_fk REFERENCES dept);Table created.
Table created.ALTER TABLE dept DROP CONSTRAINT emp_dept_fk;ALTER TABLE dept DROP CONSTRAINT emp_dept_fk
*
ERROR at line 1:
ORA-02443: Cannot drop constraint - nonexistent constraint
Help: https://docs.oracle.com/error-help/db/ora-02443/COLUMN constraint_name FORMAT A12
COLUMN table_name FORMAT A10
COLUMN r_constraint_name FORMAT A10
SELECT constraint_name, constraint_type, table_name, r_constraint_name FROM user_constraints WHERE constraint_name = 'EMP_DEPT_FK';CONSTRAINT_N C TABLE_NAME R_CONSTRAI
------------ - ---------- ----------
EMP_DEPT_FK R EMP DEPT_PK
1 row selected.ALTER TABLE emp DROP CONSTRAINT emp_dept_fk;Table altered.03The same DROP CONSTRAINT was run again
products_price_ck had already been dropped. Running the same ALTER TABLE products DROP CONSTRAINT products_price_ck again failed with ORA-02443.
user_constraints returned 0 rows for that name. For scripts that may run more than once, we used a PL/SQL block that drops it only if it exists. It printed skip: PRODUCTS_PRICE_CK does not exist.
Setup
CREATE TABLE products (product_id NUMBER PRIMARY KEY, price NUMBER CONSTRAINT products_price_ck CHECK (price >= 0));
ALTER TABLE products DROP CONSTRAINT products_price_ck;Table created.
Table altered.ALTER TABLE products DROP CONSTRAINT products_price_ck;ALTER TABLE products DROP CONSTRAINT products_price_ck
*
ERROR at line 1:
ORA-02443: Cannot drop constraint - nonexistent constraint
Help: https://docs.oracle.com/error-help/db/ora-02443/SELECT COUNT(*) AS price_ck FROM user_constraints WHERE constraint_name = 'PRODUCTS_PRICE_CK'; PRICE_CK
----------
0
1 row selected.SET SERVEROUTPUT ON
DECLARE
n NUMBER;
BEGIN
SELECT COUNT(*) INTO n FROM user_constraints WHERE constraint_name = 'PRODUCTS_PRICE_CK';
IF n > 0 THEN
EXECUTE IMMEDIATE 'ALTER TABLE products DROP CONSTRAINT products_price_ck';
DBMS_OUTPUT.PUT_LINE('dropped');
ELSE
DBMS_OUTPUT.PUT_LINE('skip: PRODUCTS_PRICE_CK does not exist');
END IF;
END;
/skip: PRODUCTS_PRICE_CK does not exist
PL/SQL procedure successfully completed.FAQ
What does ORA-02443 mean?
The table named in ALTER TABLE has no constraint with the name you gave in DROP CONSTRAINT.
How do I find the name of a constraint in Oracle?
Join user_constraints and user_cons_columns on constraint_name and filter by table_name and column_name.
How do I drop a SYS_C constraint without knowing its name?
Look up the name by table, type and column in a PL/SQL block, then run EXECUTE IMMEDIATE 'ALTER TABLE t DROP CONSTRAINT ' || v_name.
Which table do I drop a foreign key from?
From the child table that has the FK column. user_constraints.table_name shows it.
How we verify
Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.
lab_a and lab_b are ordinary users created for the test; system is the DBA account. Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free 23.26.3.0.0