IBM Books

SQL Reference

CREATE NODEGROUP

The CREATE NODEGROUP statement creates a new nodegroup within the database and assigns partitions or nodes to the nodegroup, and records the nodegroup definition in the catalog.

Invocation

This statement can be embedded in an application program or issued interactively. It is an executable statement that can be prepared dynamically. However, if the bind option DYNAMICRULES BIND applies, the statement cannot be dynamically prepared (SQLSTATE 42509).

Authorization

The authorization ID of the statement must have SYSCTRL or SYSADM or authority.

Syntax

>>-CREATE NODEGROUP--nodegroup-name----------------------------->
 
      .-ON ALL NODES-------------------------------------------------------.
>-----+--------------------------------------------------------------------+>
      |                    .-,--------------------------------------.      |
      |                    V                                        |      |
      '-ON--+-NODES-+---(-----node-number1--+--------------------+--+---)--'
            '-NODE--'                       '-TO--node-number2---'
 
>--------------------------------------------------------------><
 

Description

nodegroup-name
Names the nodegroup. This is a one-part name. It is an SQL identifier (either ordinary or delimited). The nodegroup-name must not identify a nodegroup that already exists in the catalog (SQLSTATE 42710). The nodegroup-name must not begin with the characters "SYS" or "IBM" (SQLSTATE 42939).

ON ALL NODES
Specifies that the nodegroup is defined over all partitions defined to the database (db2nodes.cfg file) at the time the nodegroup is created.

If a partition is added to the database system, the ALTER NODEGROUP statement should be issued to include this new partition in a nodegroup (including IBMDEFAULTGROUP). Furthermore, the REDISTRIBUTE NODEGROUP command must be issued to move data to the partition. Refer to the Administrative API Reference or the Command Reference for more information.

ON NODES
Specifies the specific partitions that are in the nodegroup. NODE is a synonym for NODES.

node-number1
Specify a specific partition number. 68

TO node-number2
Specify a range of partition numbers. The value of node-number2 must be greater than or equal to the value of node-number1 (SQLSTATE 428A9). All partitions between and including the specified partition numbers are included in the nodegroup.

Rules

Notes

Example

Assume that you have a partitioned database with six partitions defined as: 0, 1, 2, 5, 7, and 8.


Footnotes:

68
node-name of the form 'NODEnnnnn' may be specified for compatibility with the previous version.


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

[ DB2 List of Books | Search the DB2 Books ]