Reputation: 615
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
Upvotes: 1
Views: 1108
Reputation: 6639
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.
Upvotes: 1
Reputation: 60262
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
Upvotes: 1