DB2 commands (1)

Source: Internet
Author: User
Tags db2 connect db2 connect to
DB2 command Overview

View the local node directory

DB2 Li St node directory

 

 

View the system database directory
DB2 Li St database directory

 

 

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.