Ways to rename schema objects - Oracle Schema

Q.  To rename an object, it must be in your schema. What are the ways to rename the schema objects?
- Published on 04 Aug 15

a. Drop and re-create the object
b. Rename the object using the RENAME statement
c. Create the object
d. Both A & B

ANSWER: Both A & B
 

    Discussion

  • Nirja Shah   -Posted on 25 Sep 15
    - To rename an object, it must be in your schema. You can rename schema objects in either of the following ways:
    1. Drop and re-create the object
    2. Rename the object using the RENAME statement
    3. Rename the object using the ALTER ... RENAME statement (for indexes and triggers)

    - If you drop and re-create an object, all privileges granted for that object are lost. Privileges must be regranted when the object is re-created.

    - A table, view, sequence, or a private synonym of a table, view, or sequence can be renamed using the RENAME statement.

    - When using the RENAME statement, integrity constraints, indexes, and grants made for the object are carried forward for the new name.

    - Before renaming a schema object, consider the following effects:
    1. All views and PL/SQL program units dependent on a renamed object become invalid, and must be recompiled before next use.
    2. All synonyms for a renamed object return an error when used.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)