The following steps set up TCP/IP access to a remote DB2 database. This will enable you to communicate with your DB2 server installed on the DB2WAS machine.
- Edit the windir\system32\drivers\etc\services file to add an entry for the DB2 connection port of the remote server:
db2cdb2 50000/tcp #Connection port of remote DB2 instance db2 - Open a DB2 command window by clicking Start>Programs>IBM DB2>Command Window.
- To access the administrative database via TCP/IP, the remote DB2 node must first be cataloged:
D:\>db2 catalog tcpip node HTTPWAS remote DB2WAS server DB2CDB2.Important: The service_name specified in the catalog command must be the same as the entry added to the Windows services file. The node_name chosen can be any valid DB2 node name. We use the computer's network name as our node_name for this example.
- The administrative database must now be cataloged as part of this remote TCP/IP node:
D:\>db2 catalog db was1 as was at node HTTPWAS - Verify connection to the remote database via TCP/IP:
D:\>db2 connect to was user db2admin_user using db2admin_passwd D:\>db2 disconnect was
where db2admin_user and db2admin_passwd are the DB2 administration account and password respectively on the remote DB2 server.
- Test connection to the remote database using the WebSphere access account. This access method mimics how WebSphere will access the administrative database.
D:\>db2 connect to was user was_user using was_password D:\>db2 disconnect was
Important: The was_user access account was created during the installation of WAS on the DB2WAS machine.
- Close the DB2 command window.