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-01418 means Oracle could not find the index named in DROP INDEX or ALTER INDEX. Often the index really is gone, but it can also live in another schema or have a case-sensitive name.
Below are three common cases reproduced on a real database, with the fix we ran and its result.
01The index was already dropped together with the primary key
orders had CONSTRAINT orders_pk PRIMARY KEY, so Oracle created an index named ORDERS_PK for it. After ALTER TABLE orders DROP PRIMARY KEY, running DROP INDEX orders_pk failed with ORA-01418.
user_indexes returned 0 rows for ORDERS_PK: the index created for the primary key had been dropped along with it. For scripts that may hit this, we used a PL/SQL block that drops the index only if it exists. It printed skip: ORDERS_PK does not exist.
Setup
CREATE TABLE orders (order_id NUMBER CONSTRAINT orders_pk PRIMARY KEY, amount NUMBER);
ALTER TABLE orders DROP PRIMARY KEY;Table created.
Table altered.DROP INDEX orders_pk;DROP INDEX orders_pk
*
ERROR at line 1:
ORA-01418: specified index does not exist
Help: https://docs.oracle.com/error-help/db/ora-01418/SELECT COUNT(*) AS orders_pk_index FROM user_indexes WHERE index_name = 'ORDERS_PK';ORDERS_PK_INDEX
---------------
0
1 row selected.If the script drops the primary key first, you usually do not need a separate DROP INDEX for the PK index.
SET SERVEROUTPUT ON
DECLARE
n NUMBER;
BEGIN
SELECT COUNT(*) INTO n FROM user_indexes WHERE index_name = 'ORDERS_PK';
IF n > 0 THEN
EXECUTE IMMEDIATE 'DROP INDEX orders_pk';
DBMS_OUTPUT.PUT_LINE('dropped');
ELSE
DBMS_OUTPUT.PUT_LINE('skip: ORDERS_PK does not exist');
END IF;
END;
/skip: ORDERS_PK does not exist
PL/SQL procedure successfully completed.02The index belongs to another schema
The index emp_name_ix was created by lab_b on its own emp table. Running DROP INDEX emp_name_ix as lab_a failed with ORA-01418, because without a schema prefix Oracle looks only in the current user's schema.
Querying dba_indexes as a DBA showed LAB_B EMP_NAME_IX EMP. When the owner lab_b ran the same DROP INDEX, it printed Index dropped.
Setup
CREATE TABLE emp (emp_id NUMBER PRIMARY KEY, name VARCHAR2(30));
CREATE INDEX emp_name_ix ON emp (name);Table created.
Index created.DROP INDEX emp_name_ix;DROP INDEX emp_name_ix
*
ERROR at line 1:
ORA-01418: specified index does not exist
Help: https://docs.oracle.com/error-help/db/ora-01418/COLUMN owner FORMAT A8
COLUMN index_name FORMAT A12
COLUMN table_name FORMAT A10
SELECT owner, index_name, table_name FROM dba_indexes WHERE index_name = 'EMP_NAME_IX';OWNER INDEX_NAME TABLE_NAME
-------- ------------ ----------
LAB_B EMP_NAME_IX EMP
1 row selected.Dropping another user's index requires the DROP ANY INDEX privilege, so normally the owner (or a DBA) does it.
DROP INDEX emp_name_ix;Index dropped.03The index was created with a quoted lowercase name
The index was created as CREATE INDEX "members_email_ix" ..., with double quotes. DROP INDEX members_email_ix without quotes failed with ORA-01418, because unquoted names are converted to uppercase.
user_indexes showed the name stored in lowercase: members_email_ix. Using the same quoted name, DROP INDEX "members_email_ix", printed Index dropped.
Setup
CREATE TABLE members (member_id NUMBER PRIMARY KEY, email VARCHAR2(100));
CREATE INDEX "members_email_ix" ON members (email);Table created.
Index created.DROP INDEX members_email_ix;DROP INDEX members_email_ix
*
ERROR at line 1:
ORA-01418: specified index does not exist
Help: https://docs.oracle.com/error-help/db/ora-01418/COLUMN index_name FORMAT A18
SELECT index_name FROM user_indexes WHERE table_name = 'MEMBERS' AND UPPER(index_name) = 'MEMBERS_EMAIL_IX';INDEX_NAME
------------------
members_email_ix
1 row selected.Tools and generated DDL sometimes add double quotes. Avoid quoted names unless you need them.
DROP INDEX "members_email_ix";Index dropped.FAQ
What does ORA-01418 mean?
Oracle found no index with that exact name in the schema it searched. The index may be gone, owned by another user, or stored with a case-sensitive name.
How do I check if an index exists in Oracle?
Query user_indexes with WHERE index_name = 'NAME' for your own indexes, or dba_indexes (or all_indexes) to see the owner.
Does dropping a primary key drop its index?
In our test, yes. After ALTER TABLE ... DROP PRIMARY KEY, the index Oracle had created for the key was no longer in user_indexes.
How do I drop an index only if it exists?
Count it in user_indexes inside a PL/SQL block and run EXECUTE IMMEDIATE 'DROP INDEX ...' only when the count is above 0.
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