When you access a database on the server from a client in DB2, you cannot directly use the connect command. Instead, you must first establish a communication node and then establish a database connection based on the node. The specific operations on the command line are as follows: -> DB2 catalog TCPIP node ABC remote servername server 50000 -> DB2 catalog dB databasename at node ABC -> DB2 connect to databasename user uid using pwd Note: ABC in catalog TCPIP node ABC is the name of a node you can start from. The name cannot be repeated with the existing name. ABC in catalog dB databasename at node ABC refers to the name you mentioned earlier. Servername server name Databasename Database Name UID Username PWD Password In addition, if the client has already established a node with the same server, if you want to connect to another database on the server, you do not need to create another node and use the same node directly. In addition, the port after the server name is not necessarily 50000 when the node is created, depending on the Database Engineer's current settings. Related commands: Li St dB directory list accessible DB Li St node directory list Accessible Nodes Uncatalog node ABC clear node ABC Other important DB2 commands 1. view the local node directory In the command window, enter DB2 Li St node directory 2. cataloguing a TCP/IP Node Command window: DB2 catalog TCPIP node <node_name> remote Li Nux | Dynix> 3. Cancel node Cataloguing DB2 uncatalog node <node_name> 4. view the system database directory DB2 Li St database directory 5. view the local database directory DB2 Li St database directory on <drive letter> If the database is in the local database directory but not in the system database directory, you can right-click <database> in the control center and choose add, enter the name of the database to be added or click the refresh button to select a database. After joining the database, you can access the database. 6. cataloguing Database DB2 catalog database <db_name> as <db_a Li As> at node <node_name> 7. Cancel database Cataloguing DB2 uncatalog database <db_name> 8. Test the remote database connection. DB2 connect to <db_a Li As> User <user_id> using <password> |