Oracle 23.26SQLLab-verified · 2026-11-27

ORA-01418: specified index does not exist

No index with that name exists in the schema Oracle looked in, under the exact name you typed.

Oracle AI Database 26ai Free 23.26.3.0.0
ORA-01418: specified index does not exist

Jump to a cause

  1. 01The index was already dropped together with the primary key
  2. 02The index belongs to another schema
  3. 03The index was created with a quoted lowercase name

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
Setuprun as lab_a
CREATE TABLE orders (order_id NUMBER CONSTRAINT orders_pk PRIMARY KEY, amount NUMBER);
ALTER TABLE orders DROP PRIMARY KEY;
OUTPUT
Table created.


Table altered.
Reproducerun as lab_a
DROP INDEX orders_pk;
✕ ERROR
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/
Checkrun as lab_a
SELECT COUNT(*) AS orders_pk_index FROM user_indexes WHERE index_name = 'ORDERS_PK';
OUTPUT
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.

After the fixrun as lab_a
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;
/
✓ SUCCESS
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
Setuprun as lab_b
CREATE TABLE emp (emp_id NUMBER PRIMARY KEY, name VARCHAR2(30));
CREATE INDEX emp_name_ix ON emp (name);
OUTPUT
Table created.


Index created.
Reproducerun as lab_a
DROP INDEX emp_name_ix;
✕ ERROR
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/
Checkrun as system
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';
OUTPUT
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.

After the fixrun as lab_b
DROP INDEX emp_name_ix;
✓ SUCCESS
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
Setuprun as lab_a
CREATE TABLE members (member_id NUMBER PRIMARY KEY, email VARCHAR2(100));
CREATE INDEX "members_email_ix" ON members (email);
OUTPUT
Table created.


Index created.
Reproducerun as lab_a
DROP INDEX members_email_ix;
✕ ERROR
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/
Checkrun as lab_a
COLUMN index_name FORMAT A18
SELECT index_name FROM user_indexes WHERE table_name = 'MEMBERS' AND UPPER(index_name) = 'MEMBERS_EMAIL_IX';
OUTPUT
INDEX_NAME
------------------
members_email_ix

1 row selected.

Tools and generated DDL sometimes add double quotes. Avoid quoted names unless you need them.

After the fixrun as lab_a
DROP INDEX "members_email_ix";
✓ SUCCESS
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