Specifying a location alias name for multiple sites
You can override the location name that an application uses to access a server.
About this task
Db2 uses the DBALIAS value in the SYSIBM.LOCATIONS table to override the location name that an application uses to access a server.
For example, suppose that an employee database is deployed across two sites and that both sites make themselves known as location name EMPLOYEE. To access each site, insert a row for each site into SYSIBM.LOCATIONS with the location names SVL_EMPLOYEE and SJ_EMPLOYEE. Both rows contain EMPLOYEE as the DBALIAS value. When an application issues a CONNECT TO SVL_EMPLOYEE statement, Db2 searches the SYSIBM.LOCATIONS table to retrieve the location and network attributes of the database server. Because the DBALIAS value is not blank, Db2 uses the alias EMPLOYEE, and not the location name, to access the database.
If the application uses fully qualified object names in its SQL statements, Db2 sends the statements to the remote server without modification. For example, suppose that the application issues the statement SELECT * FROM SVL_EMPLOYEE.authid.table with the fully-qualified object name. However, Db2 accesses the remote server by using the EMPLOYEE alias. The remote server must identify itself as both SVL_EMPLOYEE and EMPLOYEE; otherwise, it rejects the SQL statement with a message indicating that the database is not found. If the remote server is Db2, the location SVL_EMPLOYEE might be defined as a location alias for EMPLOYEE. Db2 z/OS® servers are defined with this alias by using the DDF ALIAS statement of the DSNJU003 change log inventory utility. Db2 locally executes any SQL statements that contain fully qualified object names if the high-level qualifier is the location name or any of its alias names.