Home > Articles > Data > DB2

  • Print
  • + Share This
This chapter is from the book

Roadmap to Distributed Communications

There are several methods to set up communications between a DB2 client and a DB2 server. The methods will be introduced to help you decide which is the most suitable for your requirements. The following ways of connecting a client to a DB2 server will be reviewed:

  • Automated Configuration using Discovery

  • Automated Configuration using Access Profiles

  • Manual Configuration

DB2 Discovery

DB2 Discovery is a helpful concept to understand before attempting to set up distributed connections.

DB2 Discovery allows you to automate the configuration of remote clients connecting to DB2 databases. You can easily catalog a remote database from a client workstation without having to know any detailed communication-specific information. From the client, DB2 Discovery requests information from DB2 servers to return to the client issuing the discovery request. A discovery message is sent to the DB2 servers, and if the servers are configured to support the discovery process, data is returned to the client.

The returned data includes:

  • The instances on the DB2 server that have discovery enabled and information about the protocols that each instance supports for client connection

  • The databases defined within these instances that have discovery enabled, including the name and description for each available database

Both the database server and the client have control over DB2 Discovery. Using configuration parameters, the user can control:

  • Whether discovery is disabled or enabled, and if enabled, the discovery method that will be used

  • The protocols that DB2 Discovery uses

  • If an instance can be discovered

  • If a database can be discovered

See “Configuring DB2 Discovery” on page 93 for more details.

03fig02.gifFigure 3-2. Search and Known Discovery

The search discovery method searches the network for valid DB2 database servers that a client workstation can access. You do not need to provide specific communication information. The remote client, using the Configuration Assistant, searches the network to obtain a list of valid servers.

In the known discovery method, you must provide information about the server that you want to access, specifically the server name.

Automated Configuration Using Discovery

If you use this type of automated configuration, you do not need to provide any detailed communications information to enable the DB2 client to contact the DB2 server.

As mentioned earlier, discovery works in one of two ways:

  • Search discovery - the DB2 client searches for DB2 servers on the network.

  • Known discovery - one particular server is queried for information about the instances and databases defined there.

You can use either the Configuration Assistant or the Control Center to exploit discovery-based configuration, and this method is normally used to configure small numbers of clients.

Step-by-step examples of using discovery are given in “Configuring DB2 Clients” on page 96.

Configuring DB2 Discovery

As well as needing to have the communication protocols installed and configured, various parameters need to be correctly configured for Discovery to work. As mentioned previously, as long as DB2 is installed after the communications protocols have been installed and configured, these Discovery-related parameters should be set automatically. However, if you add a new communications protocol after DB2 is installed, or if Discovery is not working, you may need to check the parameter settings.

Restricting Discovery

As well as enabling discovery for either the search and known methods, it is also possible to disable discovery so your DB2 server cannot be located on the network. This is achieved by setting the DAS parameter DISCOVER to DISABLE. It is also possible to configure discovery on a DB2 server in a hierarchical manner. You can disable or enable at the DB2 server level, instance level, and database level. This provides you with the ability to enable discovery of your DB2 server while hiding certain instances and/or databases (Fig. 3-3).

03fig03.gifFigure 3-3. Discovery hierarchy

To set the discovery parameters for the DAS service on the server, you can use the Command Center or CLP. For example, to set the DISCOVER parameter to SEARCH and the DISCOVER_COMM parameter to TCP/IP, enter the following commands:

update admin cfg using discover search
   update admin cfg using discover_comm tcpip

To view the parameter values currently set for the DAS service, enter the following command:

get admin cfg

To set the discovery parameters for the DB2 instance or a database on the server, you can use the Control Center. Select the object, right-click on the mouse and select Configure Parameters.

To set the discovery parameters for the DB2 client, you can use the Configuration Assistant. Click on the Client Settings button and go to the Communications tag. Alternatively, you can use the update dbm cfg command from the CLP or Command Center, or if you choose, you can use the graphical interface of the DB2 Control Center to update configuration parameters.

The DAS service must be configured and running on each DB2 server you wish to locate in this manner.

  • + Share This
  • 🔖 Save To Your Account