IBM Books

Installing and Configuring DB2 Clients


Configuring Database Connections



note

To complete the steps in this section, you must be logged on to the local system as a user with System Administrative (SYSADM) authority on the instance.



note

You can configure database connections through the Add Database SmartGuide, by:


Using an Access Profile

You can use either a Server profile or a Client profile to configure database connections on a client.

Server Profiles

Server profiles can be generated for a DB2 server. They contain information about instances on the server system, and databases within each instance. The information for each instance includes the protocol information required to set up a client to connect to databases in that instance.

To generate server profiles, use the Generate Access Profile function provided in the Control Center. When a profile is generated for a DB2 server system, it includes server instances that have the discover_inst configuration parameter and databases with the discover_db configuration parameter set to ENABLE. The discover parameter in the Administration Server's configuration file must be set to either SEARCH or KNOWN to generate a profile for a server system.

For information on setting the discover_inst, discover_db and discover configuration parameters, see Setting Discovery Parameters.

Generating a Server Profile

To generate an access profile, perform the following steps:

  1. Click on Start and select Programs->DB2 for Windows NT->Administration Tools->Control Center.

  2. Click on the [+] sign beside the Systems icon to get a list of systems.

  3. Select the system to be profiled and click on the right mouse button.

  4. Select the Generate access profile option.

  5. Select the path and type in a file name for this profile, then click on the Generate push button.

To process a server profile and add its databases to the client's connection configuration list, use the Client Configuration Assistant's Import or Add functions. Using the Add function is the preferred method.

Using a Server Profile on the Client

To add a database using the Add function:

  1. Click on Start and select Programs->DB2 for Windows NT->Client Configuration Assistant.

  2. Click on the Add push button.

  3. Select the Use an access profile radio button, and click on the Next push button.

  4. Click on the Browse push button and select the profile for the server that you want to access.

  5. Select a database to be added and click on the Next push button.

  6. If desired, you can select the Alias and ODBC tabs at the top of the panel to specify a database alias name for the database, or to select CLI/ODBC options for the database. This step is optional.

  7. Click on the Done push button.

  8. You can test the connection that has been added by clicking on the Test Connection push button.

Client Profiles

Information in client profiles can be added to another client using the:

Note:This scenario assumes that the database connections configured on one client will be exported and used to set up one or more additional clients.

Exporting a Client Profile

Client profiles are generated from clients using the Export function of the CCA. Use the Export function to copy the database information used by one client to other clients.

The information contained in a client profile is determined during the export process. Depending on the settings chosen, it can contain the existing client's:

The Export function can be used to generate a customized profile that can be imported on another client to set it up, or update it.

To export a profile from the client, configure the client for communications and do the following:

  1. Enter the db2cca admin command at a command prompt to start the Client Configuration Assistant in administrator mode. (You must belong to the local Administrator group to perform this command.)

    note

    The Export function of the CCA is only available when the CCA is started in administrator mode. The CCA can be started permanently in administrator mode by modifying the Client Configuration Assistant icon to add the parameter admin to the startup. To add the parameter admin to the CCA startup:

    1. Select the CCA icon and click on the right mouse button.

    2. Select the Properties option.

    3. Add the admin parameter to the:

      • Parameters field on OS/2

      • Target field (located on the Security tab) on Windows 32-bit operating systems.

  2. Click on the Export push button.

  3. Select the databases to be exported from the Available DB2 Databases window, and add them to the Databases to be exported window.

  4. Select the check boxes that correspond to the options that you want to set up for the target client.

    To customize settings, click on the appropriate Customize push button. The settings that you customize will only affect the profile to be exported, no changes will be made to your workstation. For more information, click on the Help push button.

  5. Click on OK.

  6. Enter a path and file name for the Client profile.

Importing a Client Profile:

Perform these steps at the client that you want to set up.

  1. Click on Start and select Programs->DB2 for Windows NT->Client Configuration Assistant.

  2. Click on the Import push button.

  3. Select the path and filename of the client profile you want to import and click on OK.

  4. The Import Client Profile window opens. Select the items you want to import. For more information, click on the Help push button.

  5. Click on OK.

    note

    If databases are contained in the client profile that you are importing, and you select to import them, the Add Database SmartGuide starts to allow you to selectively import the databases you want to connect to.

Searching the Network for Databases

Instead of entering protocol information to make a connection to remote database servers, you can use the CCA to find all the databases on your local network by following these steps:



note

The following scenario assumes that messages used by the Search method of discovery are not filtered by your network, and that the installation defaults on the client and the server have not been changed. To run the following scenario, you must ensure that the discover parameter in the database manager configuration file on the client, and the discover parameter in the Administration Server configuration file on the server are set to SEARCH. Also, the discover_comm parameter must be set to the search protocols used on the client and Administration Server.

  1. Start the Client Configuration Assistant (CCA).

  2. Click on the Add push button on the CCA's main panel to start the Add Database SmartGuide.

  3. Select the Search the network radio button, and click on the Next push button.

  4. Click on the [+] sign beside the Known Systems icon to list all the systems known to your client.

    1. Click on the [+] sign beside a system to get a list of the instances and databases on it. Select the database that you want to add and proceed to Step 5.

    2. If the system that contains the database that you want is not listed, click on the [+] sign beside the Other Systems (Search the network) icon to search the network for additional systems. Click on the [+] sign beside a system to get a list of the instances and databases on it. Select the database that you want to add and proceed to Step 5.

    3. If the system you want is still not listed, it can be added to the list of systems by clicking on the Add Systems push button.

  5. If desired, you can select the Alias and ODBC tabs at the top of the panel to specify a database alias name for the database, or to select CLI/ODBC options for the database. This step is optional.

  6. Click on the Done push button.

  7. You can test the connection that has been added by clicking on the Test Connection push button.

Searching the network can be customized to meet the needs of individual organizations. The material that follows provides details on this customization. Refer to the Administration Guide for more information on individual configuration parameters and profile registry values.

Choosing a Discovery Method

Network searching uses a DB2 facility called Discovery to obtain information from DB2 servers. This information is used to configure clients for database connections.
Note:Discovery cannot retrieve information about pre-Version 5 DB2 systems.

Two discovery methods are available for searching the network:

Search may appear to be a simpler discovery method. However, in larger networks, network routers and bridges can filter the messages that Search uses to find DB2 servers on the network, resulting in an incomplete or even empty list. In this case, use the Add System method; its messages are not filtered by routers and bridges. If in doubt, contact your network administrator for assistance.

To have the server support Known discovery, set the discover parameter in the Administration Server configuration file to KNOWN. To have it support Search discovery, set this parameter to SEARCH (which also supports all the facilities of Known discovery). To prevent discovery of a server, and all of its instances and databases, set discover to DISABLE.

On the client, enabling discovery is also done using the discover parameter; however, in this case, the discover parameter is set in the client instance (or a server acting as a client) as follows:

Known
Allows the CCA to refresh systems in the known list, and to add new systems to the list by using the Add Systems push button. When the discover parameter is set to KNOWN, the CCA will not be able to search the network.

Search
Enables all the facilities of Known discovery, and enables network searching.

Disable
Disables discovery. In this case, the Search the network option is not available in the Add Database SmartGuide.


note

The discover parameter defaults to SEARCH on all client and server instances. The discover parameter defaults to SEARCH on all Administration Servers except Administration Servers installed in a UNIX Extended Enterprise Edition environment, where discover defaults to KNOWN.

Additional Settings for Search Discovery

Search discovery requires that the discover_comm parameter be set on both the server (in the Administration Server's configuration file) and the client (in the database manager configuration file).

The discover_comm parameter is used to control the communication protocols that the server will listen to for search requests from clients, and that clients will use to send out search requests. The discover_comm parameter can be any combination of TCP/IP and NetBIOS; the protocols supported by Search discovery.

On the Administration Server, the values specified for discover_comm must be equal to, or a subset of, the values set for db2comm.

note

To avoid problems with the Control Center and the Client Configuration Assistant, ensure that the DB2COMM parameter is set in the DB2 registry using the db2set command. It is not recommended that you use any other mechanism to set the DB2COMM value.

On the server, the discover_comm parameter is set in the Administration Server's configuration file. On the client (or a server acting as a client), discover_comm is set in the database manager configuration file.
Note:When using Search discovery, at least one protocol specified by the discover_comm parameter on the client must match those specified by the discover_comm parameter on the Administration Server. If there is no match, the server will not respond to the client's requests.


Figure hint not displayed.

Check the settings for the db2comm registry value by entering the db2set DB2COMM command. For more information, see Chapter 15. Controlling Your DB2 Environment.

In addition, there are two DB2 profile registry values that can be used to tune Search discovery via NetBIOS on the client: db2discoverytime and db2nbdiscoverrcvbufs. The default values should be suitable in most cases. For more information, refer to the Administration Guide.

Hiding Server Instances and Databases from Discovery

You may have multiple instances, and multiple databases within these instances, on a server. You may want to hide some of these from the discovery process.

To allow clients to discover server instances on a system, set the discover_inst database manager configuration parameter in each server instance on the system to ENABLE (this is the default value). Set this parameter to DISABLE to hide this instance and its databases from discovery.

To allow a database to be discovered from a client, set the discover_db database configuration parameter to ENABLE (this is the default value). Set this parameter to DISABLE to hide the database from discovery.

Setting Discovery Parameters

discover and discover_comm
The discover and discover_comm parameters are set in the Administration Server configuration file on the server system, and in the database manager configuration file on the client. Set these parameters as follows:

discover_inst and discover_db
Use the Control Center to set the discover_inst and discover_db parameters. To set these parameters, follow these steps:

  1. Start the Control Center.

  2. Click on the [+] sign beside the Systems icon to get a list of systems.

  3. Click on the [+] sign beside a system icon to get a list of instances on it.

  4. Select the instance that you want to configure and click on the right mouse button.

  5. Select the Configure option from the pop-up menu. The Configuration Instance window opens.

  6. Select the Environment tab and select the discover_inst parameter from the Parameters box.

  7. Select the desired value from the Value box and click on OK.

  8. Click on the [+] beside an instance icon to get a list of databases in it.

  9. Select the database that you want to configure and click on the right mouse button.

  10. Select the Configure option from the pop-up menu. The Configuration Database window opens.

  11. Select the Environment tab and select the discover_db parameter.

  12. Select the desired value from the Value box and click on OK.

db2discoverytime and db2nbdiscoverrcvbufs
The db2discoverytime and db2nbdiscoverrcvbufs profile registry values are set in the client instance (or a server acting as a client). Set these parameters as follows:

Manually Configure a Connection to a DB2 Database

Manually configuring a database connection requires you to know:

With this information, the SmartGuide will guide you through the steps necessary to add the database connection.

  1. Start the Client Configuration Assistant (CCA).

  2. Click on the Add push button on the CCA's main panel to start the Add Database SmartGuide.

  3. Select the Manually configure a connection to a DB2 database radio button, and click on the Next push button.

  4. Select the protocol that you will use to connect to the database and click on the Next push button.

  5. Enter the required protocol parameters and click on the Next push button.

  6. In the Target database panel, enter the name of the remote database alias in the Target Database field.

    note

    When a database is created on the remote server, if a database alias is not specified during database creation, the database is created with a database alias=database_name; otherwise, the database alias is the name specified.

  7. If desired, you can select the Alias and ODBC tabs at the top of the panel to specify a local database alias name or select CLI/ODBC options for the remote database. This step is optional.

  8. Click on the Done push button.

  9. You can test the connection that has been added by clicking on the Test Connection push button.


Figure car not displayed.

When you add a database using this configuration method, the Client Configuration Assistant will generate a default node name for the database.

For example, if you used TCP/IP to add the database to your system, the instance name could be TCP0000.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]