More than N basic DB2 operation commands

Source: Internet
Author: User
Tags db2 connect db2 connect to

The following articles mainly explain to you 30 Basic DB2 operation commands. If you are curious about the 30 Basic DB2 operation commands, the following is a detailed description of the article's 30 Basic DB2 operation commands. I hope you will gain some benefits after browsing the following content.

It mainly includes the import and export of the DB2 database, the viewing of the storage process, and version migration commands that we often use in actual operations. The following is the main content of the body.

1. view the local node directory

In the command window, enter db2 list node directory.

2. cataloguing a TCP/IP Node

Command window: db2 catalog tcpip node remote server ostype

3. Cancel node Cataloguing

Db2 uncatalog node

4. view the system database directory

Db2 list database directory

5. view the local database directory

Db2 list 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 as at node

7. Cancel database Cataloguing

Db2 uncatalog database

8. Test the remote database connection.

Db2 connect to user using

9. Any user can set the default mode for a specific database connection by setting the CurrentSchema special register. The initial default value is the permission ID of the current session user.

Set schema =

This statement can be used interactively or in applications. If you bind a package with the DynamicrulesBind option, this statement does not work. This statement is not under transaction control.

DB2 basic operation command 10. code page settings

Set character sets when creating databases

Create database using codeset territory

22. How do I view the complete reference constraints of a table?

SELECT * from syscat. references where tabname =

23. How do I know the BUFFERPOOLS status?

Select * from SYSCAT. BUFFERPOOLS

24. How can I view and modify instance and database configuration parameters in the command line?

View instance configuration parameters: db2 get dbm cfg

Modify instance configuration parameters: db2 update dbm cfg using parameter name New Value

View database configuration parameters: db2 get db cfg

Modify database configuration parameters: New Value of the db2 update db cfg for using parameter name

25. How to modify the buffer?

Add a buffer: create bufferpool size [pagesize 4096] {[not] extended storage} modify the buffer: alter bufferpool size {[not] extended storage}

Delete Buffer: drop bufferpool

If the buffer size is set to-1, the number of pages of the buffer pool is determined by the buffpage parameter configured by the database.

Note: The Database Configuration Parameter buffpage only applies to the buffer pool with the buffer size set to-1.

26. how to use in/not in select * from tabschema without using the select clause when multiple fields exist. tabname where (colA, colB, colC) [not] in (valueA1, valueB1, valueC1), (valueA2, valueB2, valueC2 ),... (valueAn, valueBn, valueCn ))

DB2 basic operation instructions 27. view the applications currently connected to the database

Db2 list application [show detail]

28. How to confirm the consistency of the DB2 database

Db2dart/DB indicates to check the consistency of the entire database

29. Export the data of a table

Export

For example, export a user table.

Export to c: \ user. ixf of ixf select * from user

DB2 basic operation instructions 30. Import Data

Import from

For example, import a user table. You can create a new table directly during import. If the table exists, you can use INSERT or UPDATE.

Related Article

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.