This statement deletes a synonym.
DROP [PUBLIC] SYNONYM [ schema. ]synonym;
Specify PUBLIC to delete a public synonym. If you do not specify PUBLIC, a private synonym is deleted.
[ schema. ]synonym
The schema field specifies the schema to which the current synonym belongs. If PUBLIC is specified, you do not need to specify the schema field for the synonym. The synonym field specifies the name of the synonym.
Delete a synonym.
OceanBase(TEST@TEST)>drop synonym test.s1; Query OK, 0 rows affected (0.04 sec)
Delete a public synonym.
OceanBase(TEST@TEST)>drop public synonym syn_pub; Query OK, 0 rows affected (0.03 sec)
When you delete a synonym, you must have the following permissions:
If you need to delete a private synonym:
The synonym to be deleted must be under the corresponding schema.
You must have the DROP ANY SYNONYM permission.
When you delete a public synonym, you must have the DROP PUBLIC SYNONYM permission.
When you delete a public synonym, you must specify the PUBLIC keyword and do not specify the schema.