Registering nicknames for Db2 tables and views
For each Db2 server definition, register a nickname for each table and view that you want to access. Then use the nicknames, not the names of the data source objects, when you query the Db2 database.
Before you register a nickname, use the Db2 RUNSTATS command to update the statistics at the Db2 data source. The federated server uses the data source statistics to optimize query processing.
Before you begin
To create a nickname, you specify a unique name and the name of your remote object, for example, a table or view. For Db2 Database you can also specify the alias of a table, view, or nickname. For Db2 for z/OS® or Db2 for IBM® i, you can specify the alias of a table or view.
About this task
You cannot create a nickname on a Db2 database alias.
To register a nickname, use one of the following methods:
|Use the Administration Explorer in IBM Data Studio.||In the Federated Database Objects folder, right-click the Nicknames folder, and select Create Nickname.|
|Issue the CREATE NICKNAME statement.||
When you create the nickname, the federated server queries the data source catalog by using the nickname. This query tests the connection to the data source table or view. If the connection does not work, you receive an error message.
After you complete this task, you can use nicknames to access data source objects and perform many other operations such as creating a nickname over a temporal table.