Updating the services for multiple Db2 instances

IBM® Db2® database instances must be able to communicate through the network. If you have multiple Db2 instances on the same computer, ensure that the SVCENAME and listener port are configured. Otherwise, connection errors might occur.

To verify that the Db2 database instances are configured for network communication:

  • DB2SET must show TCPIP for the DB2COMM setting.
  • The SVCENAME in the DBM configuration must show a valid TCP service name and TCP port number.

If you changed either the Db2 registry (DBSET) or the Database Manager configuration, ensure that you stop and restart Db2.

Procedure

  1. Log on to the database server as the Db2 instance owner.
  2. To reserve a TCP port for the service, append the information to the services file.

    On Windows, edit the %systemroot%\system32\drivers\etc\services file

    On Linux®, edit the /etc/services file.

    To reserve TCP port 5500 for the service named db2c_opdb, append the following line to the end of the services file:
    db2c_opdb 5500/tcp
  3. Update the database manager configuration.

    db2 update database manager configuration using svcename 55000

  4. Ensure that TCP communication is set for the database instance.
    db2cmd -i -w
    db2set DB2COMM=npipe,tcpip
    db2stop
    db2start
  5. Stop and then restart the Db2 server.
    db2stop
    db2start