DB2 Multi-Partition Management summary

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

DB2 's multiple partitioning management is often a bit challenging, but many times the differences between multiple and single partitioning are not very large, as summarized below are common operations management commands:

Start the database node for the specified partition:

Db2start Dbpartitionnum Dbnodenum

In daily operation, we need to determine the current connection node number, the following is to check the current partition node number method:

DB2 Values Current Dbpartitionnum

In a daily, multiple-partition environment, you need to view the number of partition groups as follows:


When the data distribution for a multiple-partition database is uneven, you need to repartition the database partition group data:

DB2 "Redistribute Database PARTITION group 

pg123 Uniform"
DB2 "Redistribute DATABASE PARTITION GROUP pg123 using Targetmap pg123.map "
DB2" redistribute DATABASE PARTITION GROUP ibmdefaultgroup using Targetmap/home/wa Ngfg/t2.map TABLE (T2) only 


Check the distribution of partitioned table data across partitions:

SELECT Dbpartitionnum (distribution key), COUNT (*) from  
GROUP by Dbpartitionnum (distribution Key) Order by  
Dbpartitionnum (distribution key)

To view the distribution of partition maps:

SELECT Hashedvalue (distribution 

key), COUNT (*) from  
GROUP by Hashedvalue (distribution key) ORDER BY  
Hashedvalue (distribution key)

For multiple partitioning operations, you can manage multiple partitions by referring to commands such as the following:

Db2_all ' DB2 update db CFG for TESTDB using Logretain on '
db2_all ';d b2 update db cfg for TestDB USING logretain on ' 
  db2_all "DB2 CONNECT to TestDB;d B2 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.