Rename table name in Oracle Syntax

Rename table name in Oracle Syntax

We need to rename the old table with new name in Oracle with following syntax:

Syntax

ALTER TABLE table_name RENAME TO new_table_name;

Example

ALTER TABLE tran RENAME TO tran_new;

Note: You can login with the schema name inwhich you want to rename the table.

Suppose my table in SCOTT schema then i login with SCOTT schema and run the following SQL

sqlplus scott/tiger
ALTER TABLE scott.tran RENAME TO tran_new;

It will give the error if you want to execute it like

ALTER TABLE scott.tiger RENAME to scott.tran_new;

Use it as:
sqlplus scott/tiger
ALTER TABLE scott.tran RENAME TO tran_new;

This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply