Altering database partition groups—removing partitions from a database partition group
Usually, removing partitions from a database partition group is a seldom operation. It may be performed, for example, when a server containing the partitions is removed and commissioned from the configuration, or a partition is not placed optimally and induces performance problems. This is the first step if we want to drop the database partitions from the database.
Getting ready
In this recipe, we will remove partitions 3
and 4
, added before to the NAVDATAGRP
database partition group, and redistribute data on the remaining partitions.
How to do it...
It is highly recommended, before you begin, to drop a partition from a database partition group to perform a full database backup.
Using the command line
To remove partitions
3
and4
, execute the following command:[db2instp@nodedb21 ~]$ db2 "ALTER DATABASE PARTITION GROUP NAVDATAGRP DROP DBPARTITIONNUMS (3 TO 4)" SQL1759W Redistribute database partition group...