How node groups work with DB2 Multisystem

A node group is a system object (*NODGRP), which is stored on the system on which it was created.

A node group is not a distributed object. The *NODGRP system object contains all the information about the systems in the group as well as information about how the data in the data files should be partitioned (distributed). The default partitioning is for each system (node) to receive an equal share of the data.

The partitioning is handled using a hash algorithm. When a node group is created, partition numbers ranging from 0 to 1023 are associated with the node group. With the default partitioning, an equal number of partitions are assigned to each of the nodes in the node group. When data is added to the file, the data in the partitioning key is hashed, which results in a partition number. The entire record of data is not hashed-only the data in the partitioning key is hashed through the hash algorithm. The node that is associated with the resulting partition number is where the record of data physically resides. Therefore, with the default partitioning, each node stores an equal share of the data, provided that there are enough records of data and a wide range of values.

If you do not want each node to receive an equal share of the data or if you want to control which systems have specific pieces of data, you can change how the data is partitioned, either by specifying a custom partitioning scheme on the Create Node Group (CRTNODGRP) command using the partition file (PTNFILE) parameter, or by changing the partitioning scheme later using the Change Node Group Attributes (CHGNODGRPA) command. Using the PTNFILE parameter, you can set the node number for each of the partitions within the node group; in other words, the PTNFILE parameter allows you to tailor how you want data to be partitioned on the systems in the node group. (The PTNFILE parameter is used in an example in Creating node groups using the CRTNODGRP command with DB2® Multisystem.) For more information about partitioning, see Partitioning with DB2 Multisystem.

Because a node group is a system object, it can be saved and restored using the Save Object (SAVOBJ) command and the Restore Object (RSTOBJ) command. You can restore a node group object either to the system on which it was created or to any of the systems in the node group. If the node group object is restored to a system that is not in the node group, the object is unusable.

Related concepts
Create Node Group (CRTNODGRP) command
Partitioning with DB2 Multisystem