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:- ALTER TABLE
- DROP TABLE
- RENAME TABLE
- TRUNCATE
- ALTER VIEW
- DROP VIEW
- ALTER SEQUENCE
- DROP SEQUENCE
Examples
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