If i have to rename a table which has got synonyms, partitions, read permissions to other users etc.

what would be the best method to rename with out disturbing all of those?

A quick google search lead me to

ALTER TABLE OLD_NAME RENAME TO NEW_NAME

Please let me know if this is the right approach

Thanks&Regards

有帮助吗?

解决方案

When you rename a table, the grants, partitions, indexes, triggers and constraints are not affected.

However, references to the table are not automatically updated - so you'll need to fix any synonyms, as well as any code (e.g. in views, stored procedures, packages, and triggers on other tables) that refers to the table directly.

http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_3001.htm#sthref5046

其他提示

Yes, it is a right approach to rename a table in oracle, or you can either use,

RENAME old_name TO new_name;

But it invalidates all objects that depends on this table.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top