When you have finished configuring the DB2 Connect workstation for communications, perform the following steps to test the connection on a remote database. 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 host database server (if it was not already started). |
Step 2. | Enter the following command in the DB2 Connect workstation's Command Center or command line processor to connect 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 host or AS/400 database server.
Authentication for connecting to host databases is set while configuring DB2 Connect. For more information, refer to the DB2 Connect User's Guide.
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:
db2 "select tabname from syscat.tables"
When you are finished using the database connection, enter the db2
connect reset command to end the database connection.
![]() |
You are now ready to start using DB2. For more advanced topics,
refer to the Administration Guide and the Installation and Configuration Supplement.
|
If the connection fails, check the following items:
At the host:
__ 1. | The db2comm registry value includes the value tcpip. |
__ 2. | The services file was updated correctly. |
__ 3. | The service name (svcename) parameter was updated correctly in the database manager configuration file. |
__ 4. | The database was created and cataloged properly. |
__ 5. | The database manager was stopped and started again (enter the db2stop and db2start commands on the server). |
__ 6. | The port number specified is not being used by any other process.
|
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.
For more information on the db2diag.log file, refer to the Troubleshooting Guide.
At the DB2 Connect workstation:
If the connection still fails after you verify these items, refer to the Troubleshooting Guide.