Common Management of DB2 multi-partition Databases

Source: Internet
Author: User
Tags db2 connect db2 connect to db2 values
The multi-partition management of DB2 is usually a little challenging for everyone. However, in many cases, the management of multi-partition and single-partition is not very different. The following summarizes the common operation management commands:

The multi-partition management of DB2 is usually a little challenging for everyone. However, in many cases, the management of multi-partition and single-partition is not very different. The following summarizes the common operation management commands:

The multi-partition management of DB2 is usually a little challenging for everyone. However, in many cases, the management of multi-partition and single-partition is not very different. The following summarizes the common operation management commands:

Start the database node in the specified partition:

Db2start dbpartitionnum DBNODENUM
In daily operations, we need to determine the number of the current connection node. The following describes how to check the number of the current partition node:
Db2 values current dbpartitionnum
In a daily multi-partition environment, you need to check the number of partition groups as follows:
Db2 LIST DATABASE PARTITION GROUPS SHOW DETAIL
When the data distribution of Multi-partition databases is uneven, data in the database partition group needs to be re-distributed.
Db2 "redistribute database partition group pg123 UNIFORM"
OR
Db2 "redistribute database partition group pg123 using TARGETMAP pg123.map"
Db2 "redistribute database partition group ibmdefaultgroup using targetmap/home/wangfg/t2.map TABLE (t2) ONLY"
Check the distribution of partition table data in each partition
Select dbpartitionnum (distribution key), COUNT (*)
FROM schema. table
Group by dbpartitionnum (distribution key)
Order by dbpartitionnum (distribution key)
View partition chart distribution
Select hashedvalue (distribution key), COUNT (*)
FROM schema. table
Group by hashedvalue (distribution key)
Order by hashedvalue (distribution key)
For multi-partition operations, see the following command to manage multiple partitions:
Db2_all "db2 update db cfg for testdb using logretain on"
Db2_all "; db2 update db cfg for testdb using logretain on"
Db2_all "db2 connect to testdb; db2 list tablespaces show detail"

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.