1) Creating a Synonym :
Create [or replace] [public] synonym [schema .] synonym_name for [schema .] object_name [@ dblink];
The or replace phrase allows you to recreate the synonym (if it already exists) without having to issue a DROP synonym command.
The public phrase means that the synonym is a public synonym and is accessible to all users. Remember though that the user must first have the appropriate privileges to the object to use the synonym.
The schema phrase is the appropriate schema. If this phrase is omitted, Oracle assumes that you are referring to your own schema.
The object_name phrase is the name of the object for which you are creating the synonym.
It can be one of the following:
Table,Package,View,materialized view,Sequence,java class schema object,stored procedure,user-defined object,Function,synonym.
2) destroying a Synonym :
DROP SYNONYM synonymname;
Ask Question