This section assumes that IPX/SPX is functional on the client and server workstations. See Software Requirements for the communication protocol requirements for your platform. See Possible Client-to-Server Connectivity Scenarios for the supported communication protocols for your particular client and server.
A client can access a server via Direct Addressing or File Server Addressing. See Table 14 for a list of the available IPX/SPX clients and their supported addressing methods. For a description of Direct Addressing or File Server Addressing, see Configuring IPX/SPX on the Server.
You need to know the IPX/SPX addressing method that was used to configure
the server before you configure your DB2 client. If the server was
configured to use Direct Addressing, you must configure your client to use
Direct Addressing to communicate with the server. If the server was
configured for File Server Addressing, you can choose to configure your client
to use either Direct Addressing or File Server Addressing, provided that your
client supports the method that you want to use. See Table 14 for a list of client specific IPX/SPX supported addressing
methods.
Table 14. IPX/SPX Supported Communication Methods for a DB2 Client
Client Platform | Direct Addressing | File Server Addressing |
---|---|---|
OS/2 | * | * |
UNIX | no support | |
Windows NT | * |
|
Windows 9x | * |
|
Windows 2000 | * |
|
To set up a DB2 client to use IPX/SPX communications, perform the following steps:
Step 1. | Identify and record parameter values. |
Step 2. | Configure the client:
|
Step 3. | Test the connection between the client and server.
|
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 15. IPX/SPX Values Required at the Client
Parameter | Description | Sample Value | Your Value |
---|---|---|---|
File server name (FILESERVER) |
Direct Addressing: A * value indicates that you are using Direct Addressing. File Server Addressing: The name of the NetWare file server where the database server instance is registered. This parameter must be entered in uppercase. Locate this parameter in the database manager configuration file on the
server.
|
Direct Addressing *
File Server Addressing NETWSRV
| |
DB2 server object name (OBJECTNAME) |
Direct Addressing: The server's IPX/SPX internetwork address of the form: netid.nodeid.socket# where netid is 8 bytes, nodeid is 12 bytes, and socket# is 4 bytes. To resolve this parameter, enter the db2ipxad command at the server. See A. Catalog the IPX/SPX Node for more information. File Server Addressing: The database manager server instance, represented as the object OBJECTNAME on the NetWare file server. The server's IPX/SPX internetwork address is stored and retrieved from this object. This parameter must be entered in uppercase and be unique on the NetWare file server system. Locate this parameter in the database manager configuration file on the
server.
|
Direct Addressing 09212700.400011527745.879E
File Server Addressing DB2INST1
| |
Node name (node_name) |
A local alias, or nickname, that describes the node to which you are trying
to connect. You can choose any name you want, however, all node name
values within your local node directory must be unique.
| db2node |
The following steps configure the client to communicate with the server using TCP/IP. Replace the sample values with your worksheet values.
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 file server name (FILESERVER), and the DB2 server object name (OBJECTNAME) that the client will use to access the remote DB2 server.
To catalog the IPX/SPX node, perform the following steps:
Step 1. | Log on to the system with a valid DB2 user ID. For more
information, see Appendix F, Naming Rules.
| ||||
Step 2. | If you are using a UNIX client, set up the instance environment and invoke the DB2 command line processor. Run the start-up script as follows: . INSTHOME/sqllib/db2profile (for Bourne or Korn shell) source INSTHOME/sqllib/db2cshrc (for C shell) where INSTHOME is the home directory of the instance. | ||||
Step 3. | Catalog the node by entering the following commands in the command line processor: catalog ipxspx node node_name remote FILESERVER server OBJECTNAME terminate
|
| If you need to change values that were set with the catalog
node command, perform the following steps:
|
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. By default, 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:
Step 1. | Log on to the system with a valid DB2 user ID. For more
information, see Appendix F, Naming Rules.
| ||||||
Step 2. | Fill in the Your Value column in the following
worksheet.
Table 16. Worksheet: Parameter Values for Cataloging Databases | ||||||
Step 3. | If you are using a UNIX client, set up the instance environment and invoke the DB2 command line processor. Run the start-up script as follows: . INSTHOME/sqllib/db2profile (for bash, Bourne or Korn shell) source INSTHOME/sqllib/db2cshrc (for C shell) where INSTHOME represents the home directory of the instance. | ||||||
Step 4. | Catalog the database by entering the following commands: db2 catalog database database_name as database_alias at node node_name db2 terminate For example, to catalog a remote database called sample so that it has the alias tor1, on the node db2node, enter the following commands: db2 catalog database sample as tor1 at node db2node db2 terminate
|
After configuring the client for communications, you will need to connect to a remote database to test the connection.
Step 1. | Start the database manager by entering the db2start command on the server (if it was not automatically started at boot time). |
Step 2. | If you are using a UNIX client, run the start-up script as follows: . INSTHOME/sqllib/db2profile (for Bash, Bourne or Korn shell) source INSTHOME/sqllib/db2cshrc (for C shell) where INSTHOME represents the home directory of the instance. |
Step 3. | Enter the following command on the client to connect the client to the remote database: db2 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 for a DB2 server and on the host or AS/400 machine for a DB2 Connect server.
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 CLP:
"select tabname from syscat.tables"
When you are finished using the database connection, enter the command reset command to end the database connection.
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 for a DB2 server and on the host or AS/400 machine for a DB2 Connect server.
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"
When you are finished using the database connection, enter the db2 connect reset command to end the database connection.
If the connection fails, check the following items:
At the server:
__ 1. | The db2comm registry value includes the value
ipxspx.
| ||
__ 2. | The FILESERVER, OBJECTNAME, and IPX_SOCKET parameters were updated correctly in the database manager configuration file. | ||
__ 3. | The database was created and cataloged properly. | ||
__ 4. | The security service was started. Enter the net start db2ntsecserver command (for Windows NT and Windows 2000 servers only). | ||
__ 5. | If you are using File Server Addressing, ensure that the DB2 server was registered at the NetWare file server after the database manager configuration file was updated with the required IPX/SPX parameters. | ||
__ 6. | The database manager was stopped and started again (enter the db2stop and db2start commands on the server).
|
| If there are problems starting a protocol's connection managers, a
warning message appears and the error messages are logged in the
db2diag.log file located in the
INSTHOME/sqllib/db2dump directory for UNIX platforms or in the
x:\sqllib\db2dump directory for non-UNIX platforms.
For more information on the db2diag.log file, refer to the Troubleshooting Guide. |
At the client:
__ 1. | If you are using Direct Addressing, check that the node was cataloged with a value of * for FILESERVER, and the correct IPX/SPX internetwork address value for the OBJECTNAME parameter. |
__ 2. | If you are using File Serving Addressing, check that the FILESERVER and OBJECTNAME parameters, used to catalog the node, match those configured on the server. |
__ 3. | The node name (node_name) that was specified in the database directory points to the correct entry in the node directory. |
__ 4. | The database was cataloged properly, using the server's database alias (the database_alias that was cataloged when the database was created on the server), as the database name (database_name) on the client.
|
If the connection still fails after you verify these items, refer to the Troubleshooting Guide.