IBM Books

Installing and Configuring DB2 Clients


Configuring Named Pipes on the Client

This section assumes that Named Pipes is functional on the client and DB2 server workstations. See "Software Requirements" for the communication protocol requirements for your platform. See "Possible Client-to-DB2 Server Connectivity Scenarios" for the supported communication protocols for your particular client and server.

The following steps are required to set up a client to use Named Pipe communications:

  1. Identify and record parameter values.

  2. Configure the client:

    1. Catalog the Named Pipes node.

    2. Catalog the database.

  3. Test the connection between the client and server.

Step 1. Identify and Record Parameter Values

As you proceed through the configuration steps, complete the Your Value column in the following table. You can fill in some of the values before you start configuring this protocol.

Table 9. Named Pipe Values Required at the Client
Parameter Description Sample Value Your Value
Computer name (Computer_name)

The Computer name of the server machine where the DB2 database resides.

On the server machine, to locate the value for this parameter, click on the Start button and select Settings->Control Panel. Double-click on the Network folder and select the Identification tab. Record the Computer name.

server1  

Instance name (Instance_name)

The name of the DB2 instance where the database resides.

db2  
Node name (Node_name)

A local alias, or nickname, that describes the node where the database resides. You can choose any name you want, however, all Node name values within your local node directory must be unique.

db2node  

Step 2. Configure the Client

The following steps describe how to configure this protocol on the client. Replace the sample values with your worksheet values.

A. Catalog the Named Pipes Node

You must add an entry to the client's node directory to describe the remote node.

This entry specifies the chosen alias (Node_name), the server's Computer name (Computer_name), and the Instance name (Instance_name) that are to be used to access the remote server.

To catalog the Named Pipes node, perform the following steps:

  1. Log on to the system as a user with System Administrative (SYSADM) or System Controller (SYSCTRL) authority.

    note

    If you have trouble logging on to the system, see "Logging on to the System".

  2. Catalog the node by issuing the following commands in the command line processor:
       catalog npipe node Node_name remote Computer_name instance Instance_name
       terminate
    

    For example, to catalog a remote node called db2node, which is located on the server called server1, in the db2 instance, use:

       catalog npipe node db2node remote server1 instance db2
       terminate
    


note

If you need to change values that were set with the catalog node command, first run the uncatalog node command in the command line processor as follows:

   uncatalog node Node_name

Recatalog the node with the value that you want to use.


B. Catalog the Database

Before a client application can access a remote database, the database must be cataloged on the server node and on any client nodes that will connect to it. When you create a database, it is automatically cataloged on the server with the Database alias (Database_alias) the same as the Database name (Database_name). The information in the database directory, along with the information in the node directory, is used on the client to establish a connection to the remote database.

To catalog a database on the client, perform the following steps.

  1. Log on to the system as a user with System Administrative (SYSADM) or System Controller (SYSCTRL) authority.

    note

    If you have trouble logging on to the system, see "Logging on to the System".

  2. Fill in the Your Value column in the following worksheet.

    Table 10. Parameter Values for Cataloging Databases
    Parameter Description Sample Value Your Value
    Database name (Database_name) The Database alias (Database_alias) of the remote database. When you create a database, it is automatically cataloged on the server with the Database alias name (Database_alias) the same as the Database name (Database_name). sample  
    Database alias (Database_alias) An arbitrary local nickname for the remote database, on the client. If you do not provide one, the default is the same as the Database name (Database_name). This is the name that you use when connecting to a database from a client. tor1  
    Node name (Node_name) The name of the node directory entry that describes where the database resides. Use the same value for Node name (Node_name) that you used to catalog the node in the previous step. db2node  

  3. Catalog the database by issuing the following commands in the command line processor:
       catalog database Database_name as Database_alias at node Node_name
       terminate
    
    For example, to catalog a remote database called sample so that it has the alias tor1, on the node db2node, use:
       catalog database sample as tor1 at node db2node
       terminate
    


    note

    If you need to change values that were set with the catalog database command, first run the uncatalog database command in the command line processor as follows:

       uncatalog database Database_alias
    

    Recatalog the database with the value that you want to use.


Step 3. Test the Client-to-DB2 Server Connection

When the configuration of the client is complete, use the following steps to verify that you can access data from a remote database:

note

You will need to connect to a remote database to test the connection. If you do not have a database on the server, create the sample database on the server to test the connection. Refer to the Quick Beginnings manual for more information.

  1. Start the database manager by issuing the db2start command on the server (if it was not automatically started at boot time).

  2. Issue the following command in the client's Command Center or command line processor to connect the client to the remote database:
       connect to Database_alias user userid using password
    

The values for userid and password must be valid for the system on which they are authenticated. By default, authentication takes place on the SERVER. If the database manager is configured for CLIENT authentication, the userid and password must be valid on the client.

If the connection is successful, you will get a message showing the name of the database to which you have connected. You are now able to retrieve data from that database. For example, to retrieve a list of all the table names listed in the system catalog table, enter the following SQL command in the Command Center or command line processor:

   "select tabname from syscat.tables" (for UNIX-based platforms)
   select tabname from syscat.tables   (for other platforms)
 

When you are finished using the database connection, issue the connect reset command to end the database connection.

note

You are ready to start using the DB2 server. See Chapter 11. "Getting Started with the DB2 Universal Database" for details.

Troubleshooting the Client-to-DB2 Server Connection

If the connection fails, check the following items:

At the server:

  1. The DB2COMM registry parameter includes the value npipe.

    * Figure hint not displayed.

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

  2. The security service was started (issue the net start db2ntsecserver command-for Windows NT servers only).
  3. The database was created and cataloged properly.
  4. The database manager was stopped and started (issue the db2stop and db2start commands on the server).


* Figure hint not displayed.

If there are problems starting a protocol's connection managers, a warning message is displayed and the error messages are logged in the db2diag.log file. The location of this file depends on your operating system.

UNIX-based Platforms
$HOME/sqllib/db2dump directory, where $HOME is home directory of the instance owner.

Other Platforms
x:\sqllib\%db2instance% directory, where x: is the drive that the client is installed and %db2instance% represents the DB2 instance.

Refer to the Troubleshooting Guide for information on the db2diag.log file.

At the client:

  1. The node was cataloged with the correct Computer name (Computer_name) and Instance name (Instance_name), of the server, where the database resides.
  2. The Node name (Node_name), specified in the database directory, points to the correct entry in the node directory.
  3. The database was cataloged properly, using the server's Database alias (Database_alias) that was cataloged when the database was created on the server, as the Database name (Database_name) on the client.

After you verify these items, refer to the Troubleshooting Guide if the connection still fails.


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

[ DB2 List of Books | Search the DB2 Books ]