Aliases and Synonyms

Aliases and Synonyms

You cannot modify aliases or synonyms in Oracle and DB2. If the definition of a synonym (alias) must be changed, you can drop and re-create it using DROP SYNONYM (ALIAS) and CREATE SYNONYM (ALIAS).

Oracle 9i

The syntax to destroy an Oracle synonym is

DROP [PUBLIC] SYNONYM <synonym_name>;

You must use the PUBLIC keyword if the synonym you are going to remove was created as a public synonym. Assuming the examples from Chapter 4,

DROP PUBLIC SYNONYM SHIPMENT;

Oracle does not invalidate any objects that the dropped synonym was referring to except for materialized views.

DB2 UDB 8.1

The syntax to remove an alias in DB2 is

DROP {ALIAS | SYNONYM} <alias_name>

For example

DROP ALIAS SHIPMT

All tables, views, and triggers that reference the dropped alias become inoperative.