- Error code
- ORA-00955
- Product
- Oracle Database
- Versions
- Oracle Database 19c, 21c, 23ai and 26ai (same wording; IF NOT EXISTS from 23ai)
- Category
- Objects, Names & Identifiers
- Last reviewed
- 24 October 2026
On this page
What it means
ORA-00955 means a CREATE statement tried to create a table, view, sequence, synonym, index or other object with a name that an object in the same schema and namespace already has.
Within a schema, each object needs a name that is unique in its namespace. Oracle's SQL Language Reference lists which objects share one namespace: tables, views, sequences, private synonyms, stand-alone procedures and functions, packages, user-defined types and operators. So a sequence cannot be called ORDERS if a table ORDERS exists. Indexes, constraints, triggers, clusters, dimensions, materialized views and private database links each have their own namespace, so a table and an index may share a name, but two indexes may not.
The message does not say which object holds the name or what type it is, so look it up in USER_OBJECTS. The usual reason is simply a script run twice. Oracle Database 23ai and later accept CREATE ... IF NOT EXISTS, which skips the statement when the object is already there; on 19c a script has to check first or handle the error.
Common causes
- A deployment or setup script is run a second time and creates objects that already exist.
- An object of a different type already has the name, for example a view, synonym or sequence called ORDERS when you create a table ORDERS.
- CREATE INDEX uses a name that another index in the schema already has.
- A previous failed or partial deployment left some objects behind.
- A materialized view is created with the name of an existing table (Oracle creates an internal table of the same name for it).
Diagnose it
Read-only These queries only read the data dictionary (USER_, ALL_ and DBA_ views) and dynamic performance views (V$). They do not change data, privileges or settings, so they are safe to run first. DBA_ and V$ views need the matching privileges.
Which object already uses the name?
Run it as the schema owner, or use ALL_OBJECTS with OWNER for another schema.
SELECT object_name, object_type, status, created, last_ddl_time
FROM user_objects
WHERE object_name = 'ORDERS'
ORDER BY object_type; The existing object and its type. If it is the same kind of object you were creating, the script has already run; if it is another type, choose a different name.
Is the index name taken?
SELECT index_name, table_name, uniqueness
FROM user_indexes
WHERE index_name = 'ORDERS_CUSTOMER_IX'; A row means the index name is already in use, possibly on a different table.
Compare the existing table with the one you meant to create
SELECT column_name, data_type, data_length, nullable
FROM user_tab_columns
WHERE table_name = 'ORDERS'
ORDER BY column_id; If the definition matches, the object is already in place and the CREATE can be skipped; if it differs, you need an ALTER (or a planned rebuild), not a second CREATE.
How to fix it
Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.
Make the script re-runnable with IF NOT EXISTS (23ai and later)
Changes schemaOn Oracle Database 23ai and 26ai, CREATE TABLE IF NOT EXISTS creates the table only if it is missing. Oracle's reference is explicit that an existing table is left as it is: if its definition differs from the statement, the old definition stays, so use it for idempotent setup scripts, not for changing a table.
CREATE TABLE IF NOT EXISTS shop.orders (
id NUMBER PRIMARY KEY,
customer_id NUMBER,
order_date DATE
);
On 19c, handle the error in the script
Changes schemaReleases before 23ai have no IF NOT EXISTS. Run the DDL through EXECUTE IMMEDIATE and ignore only ORA-00955, so any other error still stops the script.
DECLARE
name_in_use EXCEPTION;
PRAGMA EXCEPTION_INIT(name_in_use, -955);
BEGIN
EXECUTE IMMEDIATE 'CREATE SEQUENCE shop.orders_seq';
EXCEPTION
WHEN name_in_use THEN NULL; -- already there
END;
/
Use CREATE OR REPLACE where Oracle supports it
Changes schemaViews, synonyms, procedures, functions, packages, triggers and types accept CREATE OR REPLACE, which replaces the definition and keeps existing grants on the object. Tables, sequences and indexes do not.
CREATE OR REPLACE VIEW shop.open_orders AS
SELECT id, customer_id, order_date
FROM shop.orders
WHERE status = 'OPEN';
Pick another name, or drop the old object only if it is disposable
Changes schemaIf the existing object is something else entirely, give the new one a different name. Drop and re-create only when the old object is a leftover you are sure is not used, such as an empty table from a failed test deployment.
Caution: DROP TABLE deletes the data and the grants, indexes and triggers on the table. Check row counts and dependencies (ALL_DEPENDENCIES) first, never do it on a shared or production schema to make a script pass, and remember a dropped table may go to the recycle bin rather than freeing space.
DROP TABLE shop.orders_tmp;
CREATE TABLE shop.orders_tmp (id NUMBER PRIMARY KEY);
Examples
Running a setup script twice
Not reproduced here: no Oracle Database is installed for this site. The message text comes from Oracle's error reference and is the same in 19c and current releases. On 23ai and later, CREATE TABLE IF NOT EXISTS avoids it.
CREATE TABLE orders (
id NUMBER PRIMARY KEY,
customer_id NUMBER
);
-- the same script, run again later
CREATE TABLE orders (
id NUMBER PRIMARY KEY,
customer_id NUMBER
);
ORA-00955: name is already used by an existing object
A sequence with the same name as a table
Not reproduced here: no Oracle Database is installed for this site. Oracle's SQL Language Reference states that tables and sequences share a namespace, so a table and a sequence in the same schema cannot have the same name; the message format comes from its error reference. Names such as ORDERS_SEQ avoid the clash.
CREATE TABLE orders (id NUMBER PRIMARY KEY);
-- tables and sequences share one namespace
CREATE SEQUENCE orders;
ORA-00955: name is already used by an existing object
How to prevent it
Write deployment scripts so they can run twice: IF NOT EXISTS on 23ai and later, an existence check or a targeted exception handler on 19c, and CREATE OR REPLACE for views and PL/SQL. Use migration tooling that records which scripts have run.
Adopt a naming convention that separates object types, for example ORDERS for the table, ORDERS_SEQ for its sequence, ORDERS_V for a view and ORDERS_CUSTOMER_IX for an index, so names never collide across the shared namespace.
Common questions
How do I fix ORA-00955 name is already used by an existing object?
Query USER_OBJECTS for the name to see what already uses it. If it is the object you meant to create, skip the CREATE (IF NOT EXISTS on 23ai and later); if it is a different object, choose another name.
Can a table and an index have the same name in Oracle?
Yes. Indexes have their own namespace, so a table and an index can share a name. A table cannot share a name with a view, sequence, private synonym, procedure, function, package or type in the same schema.
Does Oracle support CREATE TABLE IF NOT EXISTS?
From Oracle Database 23ai, yes. It leaves an existing table unchanged even if its definition differs. On 19c, check USER_OBJECTS first or catch ORA-00955 in a PL/SQL block.
Learn more on CodeWithSQL
Official documentation
- ORA-00955 (Oracle Database Error Messages)
- Database object names and qualifiers: namespaces (Oracle SQL Language Reference 19c)
- CREATE TABLE: IF NOT EXISTS (Oracle SQL Language Reference 26ai)
- USER_OBJECTS (Oracle Database Reference 19c)
Last technically reviewed 24 October 2026; examples and diagnostics run on Oracle Database Error Messages reference (26ai, 21c and 19c); not run locally. Messages and explanations follow Oracle's Database Error Messages reference; no Oracle Database was available, so the examples were not run locally.