Wednesday, January 30, 2008

rename table

Renaming table can be surprising, if you tried both rename and alter table for renaming.

If you issue below statement, you will get following error:
alter table schema1.T1 rename to schema1.T2;

ORA-14047: ALTER TABLE|INDEX RENAME may not be combined with other operations

and if you issue below statement, you will get another surprising error:
rename schema1.T1 to schema1.T2;

ORA-01765: specifying table's owner name is not allowed

The last resort and true one is issueing:
alter table schema1.T1 rename to T2;

1 comment:

Jeff Post said...

Thank you! Could not figure that out!

Windows (powershell) counterparts of Linux commands

You may find Windows mostly powershell equivalent of frequently used Linux commands here. I will update this post, with newer ones by the ti...