ALTER SYNONYM is used to modify the attribute of a synonym.
1 2 | ALTER SYNONYM synonym_name OWNER TO new_owner; |
Name of a synonym to be modified (optionally with schema names)
Value range: A string compliant with the identifier naming rules
New owner of a synonym object
Value range: A string. It must be a valid username.
Create synonym t1.
1 | CREATE OR REPLACE SYNONYM t1 FOR ot.t1; |
Create user u1.
1 | CREATE USER u1 PASSWORD '{password}'; |
Change the owner of the synonym t1 to u1.
1 | ALTER SYNONYM t1 OWNER TO u1; |