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"