- Synonyms can be thought of as alternative names for tables and views. No authorization is required to define a synonym.
- A synonym designates a synonym when it is preceded by the keyword SYNONYM, as in CREATE SYNONYM and DROP SYNONYM. In all other contexts, a synonym designates a local table or view and can be used wherever the name of a table or view can be used in an SQL statement.
- Authorization or the CREATE ALIAS privilege is required to define an alias. No authorization is required to define a synonym.
- A synonym can only be defined on the name of a table or view at the current server.
- A synonym can only be defined on the name of an existing table or view.
- But dropping a table or view does drop its synonyms.A synonym can only be used at the DB2 subsystem where it is defined.
- For creating Synonym must mention Schema
- Aliases can be thought of as alternative names for tables and views
- An alias can be defined at a local server and can refer to a table or view that is at the current server or a remote server. The alias name can be used wherever the table name or view name can be used to refer to the table or view in an SQL statement. The rules for forming an alias name are the same as the rules for forming a table name or a view name, as explained below. A fully qualified alias name (a three-part name) can refer to an alias at a remote server. However, the table or view identified by the alias at the remote server must exist at the remote server.
- Authorization or the CREATE ALIAS privilege is required to define an alias.
- An alias can be defined on an undefined name.
- Dropping a table or view has no effect on its aliases.
- For creating Alias Schema is not required
- An alias defined at one DB2 subsystem can be used at another DB2 subsystem.