IBM Books

Quick Beginnings for DB2 Extended Enterprise Edition for UNIX


Nodegroups and Data Partitioning

You can define named subsets of one or more database partitions in a database. Each subset you define is known as a nodegroup. Each subset that contains more than one database partition is known as a multipartition nodegroup. Multipartition nodegroups can only be defined with database partitions that belong to the same database.

Three default nodegroups are created when you create a database: IBMDEFAULTGROUP, IBMCATGROUP and IBMTEMPGROUP.

If you want, you can create tables in the default nodegroups, IBMDEFAULTGROUP and IBMCATGROUP.

The IBMDEFAULTGROUP nodegroup contains all the database partitions for the database. When you create a database, a database partition is created at each database partition server (node) that is defined in the node configuration file (db2nodes.cfg).

The IBMCATGROUP nodegroup for the database is created at the database partition server where you issued the create database command. This nodegroup only contains the database partition that is local to the database partition server where the command was issued. This database partition server is referred to as the catalog node of the database because the IBMCATGROUP nodegroup contains the catalog tables for the database.

You cannot directly work with the third default nodegroup, IBMTEMPGROUP. Like the IBMDEFAULTGROUP nodegroup, it also contains all the database partitions of the database. This nodegroup is used to contain all temporary table spaces.

Figure 8 shows an example of a database in which there are three nodegroups. Nodegroup 1 is a multipartition nodegroup made of four database partitions, and nodegroups 2 and 3 are both single-partition nodegroups.

Figure 8. Nodegroups in a Database


A diagram showing nodegroups in a database


When you want to create table spaces for a database, you first create the nodegroup where the table spaces will be stored, then create a table space in the nodegroup. After this, you create the tables in the table space.

You can drop database partitions from a nodegroup, or if new nodes have been defined in the db2nodes.cfg file, you can add them to a nodegroup in a database. For information about adding and dropping nodes in nodegroups, refer to the Administration Guide.

As your database increases in size, you can add database partition servers to the database system for improved performance. This is known as scaling the database system. When you add a database partition server, a database partition is created for each database that already exists in the database system. You then add the new database partition to an existing nodegroup that belongs to that database. Then you redistribute data in that nodegroup to utilize the new database partition. For information about scaling a database system, refer to the Administration Guide .

Each table defined in a multipartition nodegroup has a partitioning key associated with it. The partitioning key is an ordered set of columns whose values are used in conjunction with a partitioning map to determine the database partition on which a row of a given table resides. The partitioning map is an array of 4 096 database partition numbers.

Columns of any data type (except LONG VARCHAR, LONG VARGRAPHIC, or LOB) can be used as the partitioning key. A table defined in a single-partition nodegroup may or may not have a partitioning key. Tables with only long-field columns can be defined only in single-partition nodegroups, and they cannot have a partitioning key. For more information about creating tables, refer to the SQL Reference.

The use of nodegroups and partitioning keys means that:

For more information about creating nodegroups, refer to the SQL Reference. For more information about using nodegroups, refer to the Administration Guide.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]