Oracle® Database SQL Language Reference 11g Release 2 (11.2) Part Number E17118-04 |
|
|
PDF · Mobi · ePub |
Use the DROP
SYNONYM
statement to remove a synonym from the database or to change the definition of a synonym by dropping and re-creating it.
See Also:
CREATE SYNONYM for more information on synonymsTo drop a private synonym, either the synonym must be in your own schema or you must have the DROP
ANY
SYNONYM
system privilege.
To drop a PUBLIC
synonym, you must have the DROP
PUBLIC
SYNONYM
system privilege.
You must specify PUBLIC
to drop a public synonym. You cannot specify schema
if you have specified PUBLIC
.
Specify the schema containing the synonym. If you omit schema
, then Oracle Database assumes the synonym is in your own schema.
Specify the name of the synonym to be dropped.
If you drop a synonym for the master table of a materialized view, and if the defining query of the materialized view specified the synonym rather than the actual table name, then Oracle Database marks the materialized view unusable.
If an object type synonym has any dependent tables or user-defined types, then you cannot drop the synonym unless you also specify FORCE
.
Specify FORCE
to drop the synonym even if it has dependent tables or user-defined types.
Caution:
Oracle does not recommend that you specifyFORCE
to drop object type synonyms with dependencies. This operation can result in invalidation of other user-defined types or marking UNUSED
the table columns that depend on the synonym. For information about type dependencies, see Oracle Database Object-Relational Developer's Guide.Dropping a Synonym: Example To drop the public synonym named customers
, which was created in "Oracle Database Resolution of Synonyms: Example", issue the following statement:
DROP PUBLIC SYNONYM customers;