DB2 10.5 for Linux, UNIX, and Windows

CREATE DATABASE PARTITION GROUP statement

The CREATE DATABASE PARTITION GROUP statement defines a new database partition group within the database, assigns database partitions to the database partition group, and records the database partition group definition in the system catalog.

Invocation

This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared only if DYNAMICRULES run behavior is in effect for the package (SQLSTATE 42509).

Authorization

The privileges held by the authorization ID of the statement must include SYSCTRL or SYSADM authority.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-CREATE DATABASE PARTITION GROUP--db-partition-group-name----->

   .-ON ALL DBPARTITIONNUMS----------------------------------------------------------------.   
>--+---------------------------------------------------------------------------------------+-><
   |                             .-,--------------------------------------------------.    |   
   |                             V                                                    |    |   
   '-ON--+-DBPARTITIONNUMS-+--(----db-partition-number1--+--------------------------+-+--)-'   
         '-DBPARTITIONNUM--'                             '-TO--db-partition-number2-'          

Description

db-partition-group-name
Names the database partition group. This is a one-part name. It is an SQL identifier (either ordinary or delimited). The db-partition-group-name must not identify a database partition group that already exists in the catalog (SQLSTATE 42710). The db-partition-group-name must not begin with the characters 'SYS' or 'IBM' (SQLSTATE 42939).
ON ALL DBPARTITIONNUMS
Specifies that the database partition group is defined over all database partitions defined to the database (db2nodes.cfg file) at the time the database partition group is created.

If a database partition is added to the database system, the ALTER DATABASE PARTITION GROUP statement should be issued to include this new database partition in a database partition group (including IBMDEFAULTGROUP). Furthermore, the REDISTRIBUTE DATABASE PARTITION GROUP command must be issued to move data to the database partition.

ON DBPARTITIONNUMS
Specifies the database partitions that are in the database partition group. DBPARTITIONNUM is a synonym for DBPARTITIONNUMS.
db-partition-number1
Specify a database partition number. (A node-name of the form NODEnnnnn can be specified for compatibility with the previous version.)
TO db-partition-number2
Specify a range of database partition numbers. The value of db-partition-number2 must be greater than or equal to the value of db-partition-number1 (SQLSTATE 428A9). All database partitions between and including the specified database partition numbers are included in the database partition group.

Rules

Notes

Examples

The following examples are based on a partitioned database with six database partitions defined as 0, 1, 2, 5, 7, and 8.