RENAME a table

If you wish to rename a table, you may have to remember some obstacles here. For instance, you are not allowed to rename somebody else’s table using their schema.table name even if you have access to this table. Oracle won’t allow it during the SQL parse phase. See below

So the right way to rename table in somebody else schema would be ALTER TABLE statement

alter table hr.employees rename new_employees;

Keep in mind, you must have access to  hr.employees object if you are working as oe user now.

What else?

You can simply rename tables like that even if they are in different schemas. You just need to grant access to the requestor.

rename employees to new_employees;
rename new_employees to employees;

 

 

One thought on “RENAME a table”

Leave a comment

Your email address will not be published. Required fields are marked *