DB2 10.5 for Linux, UNIX, and Windows

Synonym usage

You can set the DB2_COMPATIBILITY_VECTOR registry variable to restrict the use of synonyms.

Enablement

You can restrict synonym usage by setting the DB2_COMPATIBILITY_VECTOR registry variable to the hexadecimal value 0x40000 (bit position 19), and then stopping and starting the database, as follows:
db2set DB2_COMPATIBILITY_VECTOR=40000
db2stop
db2start

To take full advantage of the DB2® compatibility features for Oracle applications, you can set the DB2_COMPATIBILITY_VECTOR registry variable to ORA, which sets all the compatibility bits.

When you set the DB2_COMPATIBILITY_VECTOR registry variable to restrict synonym usage, you cannot issue the following statements with a table synonym as the target: You cannot issue the following statements with a view synonym as the target: You cannot issue the following statements with a sequence synonym as the target:

Example

The following DROP statement for a table synonym returns an error when you set the DB2_COMPATIBILITY_VECTOR registry variable to support the use of synonyms:
   CREATE TABLE T (C1 INT)
   CREATE SYNONYM S FOR TABLE T
   DROP TABLE S