MetricSign
Start free
Medium severityschema

Oracle Database Error:
ORA-00955

What does this error mean?

A CREATE statement attempted to create an object (table, view, sequence, index, etc.) with a name that already exists in the schema.

Common causes

  • 1Pipeline re-runs a CREATE TABLE statement without checking if the table already exists
  • 2Migration script is not idempotent — it fails on second execution
  • 3A previous partial run left a staging table behind
  • 4Environment setup script run multiple times

How to fix it

  1. 1Step 1: Check if the object exists: `SELECT object_name, object_type FROM user_objects WHERE object_name = UPPER('<NAME>');`.
  2. 2Step 2: Make the CREATE idempotent using exception handling in PL/SQL: `BEGIN EXECUTE IMMEDIATE 'CREATE TABLE ...'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -955 THEN RAISE; END IF; END;`.
  3. 3Step 3: Drop the existing object first if it is a leftover from a failed run: `DROP TABLE staging_name PURGE;`.
  4. 4Step 4: Use `CREATE OR REPLACE` for views, procedures, and packages — it is not available for tables.
  5. 5Step 5: For pipeline staging tables, use a TRUNCATE+INSERT pattern instead of DROP+CREATE.

Example log output

ORA-00955: name is already used by an existing object
SQL: CREATE TABLE staging_orders (id NUMBER, amount NUMBER)

Frequently asked questions

Does Oracle have CREATE TABLE IF NOT EXISTS?

Not in standard Oracle SQL, but you can achieve the same result in PL/SQL by catching SQLCODE -955 (ORA-00955) and ignoring it.

Source · docs.oracle.com/error-help/db/ora-00955

Other schema errors