ORA-00955: name is already used by an existing object
A CREATE statement used a name that another object in the same schema already has: a table, view, sequence, synonym or index with that name.
- Error code
ORA-00955- Category
- Names and objects
What it means
Tables, views, sequences, private synonyms, procedures and other schema objects share one namespace per schema, so you can't have a view and a table with the same name. ORA-00955 is raised when CREATE would reuse a taken name. Indexes and constraints have their own namespaces, but an index can still clash with another index.
Common causes
- Running a creation script a second time.
- A different kind of object (a view or synonym) already has the name.
- Creating an index whose name is already used by another index in the schema.
How to fix it
-
Find what already has the name.
SELECT object_name, object_type FROM user_objects WHERE object_name = 'ORDERS';
-
Use
CREATE OR REPLACEfor views, procedures, functions, packages, triggers and synonyms.CREATE OR REPLACE VIEW active_orders AS SELECT * FROM orders WHERE status = 'OPEN';
-
On Oracle 23ai and later, use
IF NOT EXISTSto make table creation repeatable; on older releases, drop the object first or checkuser_objectsbefore creating.CREATE TABLE IF NOT EXISTS orders (id NUMBER PRIMARY KEY);
Related errors
ORA-00942table or view does not exist2714SQL Server: There is already an object named1050MySQL: Table already exists42P07PostgreSQL: relation already exists
More names and objects errors
The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.
Work on Oracle in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Oracle and the other databases you use.