This topic takes a table object as an example to describe the errors related to existent objects and the troubleshooting procedure.
Error: ORA-00955
Error code
Error codes in OceanBase Database: 5331 and 5834
SQLSTATE: HY000
Error message
ORA-00955: name is already used by an existing object
Example
When you create a student table, this error is returned, indicating that the table already exists.
obclient> CREATE TABLE student(
id NUMBER,
name varchar(18),
sex char(1),
age NUMBER,
address varchar(200),
email varchar(100),
c_date date,
PRIMARY KEY (id)
);
ORA-00955: name is already used by an existing object
Troubleshooting procedure
Check whether this table already exists in the database. Sample code:
obclient> SELECT t.table_name tablename FROM user_tables t WHERE table_name = 'student'; +------------+ | TABLENAME | +------------+ | STUDENT | +------------+ 1 row in setIf the table already exists, check whether this table meet the business needs. If no, we recommend that you specify a new name for the new table, such as
t_stu.obclient> ALTER TABLE student RENAME TO t_stu; Query OK, 0 rows affectedNote
If the table is no longer needed, execute the
DROP TABLEstatement to drop the table so that you can then create a new one.