Purpose
Use the RENAME statement to rename a table, view, sequence, or private synonym.
a. Oracle Database automatically transfers integrity constraints, indexes, and
grants on the old object to the new object.
b. Oracle Database invalidates all objects that depend on the renamed object,
such asviews, synonyms, and stored procedures and functions that refer to a
renamed table.
Prerequisites
The object must be in your own schema.
Syntax
rename
Semantics
old_name:
Specify the name of an existing table, view, sequence, or private synonym.
new_name:
Specify the new name to be given to the existing object. The new name must not
already be used by another schema object in the same namespace and must follow
the rules for naming schema objects.
Restrictions on Renaming Objects :
Renaming objects is subject to the following restrictions:
a. You cannot rename a public synonym. Instead, drop the public synonym and
then re-create the public synonym with the new name.
b. You cannot rename a type synonym that has any dependent tables or dependent
valid user-defined object types.
Caution: You cannot roll back a RENAME statement.
[@more@]来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10599713/viewspace-971519/ ,如需转载,请注明出处,否则将追究法律责任。