DB2 Version 9.7 for Linux, UNIX, and Windows

Creating database partition groups

You create a database partition group with the CREATE DATABASE PARTITION GROUP statement. This statement specifies the set of database partitions on which the table space containers and table data are to reside.

About this task

This statement also:
To create a database partition group using the Control Center:
  1. Expand the object tree until you see the Database partition groups folder.
  2. Right-click the Database partition groups folder, and select Create from the pop-up menu.
  3. On the Create Database partition groups window, complete the information, use the arrows to move database partitions from the Available database partitions box to the Selected database partitions box, and click OK.
To create a database partition group using the command line, enter:
CREATE DATABASE PARTITION GROUP db-partition-group-name 
   ON DBPARTITIONNUM (db-partition-number1,db-partition-number1)
or
CREATE DATABASE PARTITION GROUP db-partition-group-name 
   ON DBPARTITIONNUMS (db-partition-number1 
   TO db-partition-number2)
For example, assume that you want to load some tables on a subset of the database partitions in your database. You would use the following command to create a database partition group of two database partitions (1 and 2) in a database consisting of at least three (0 to 2) database partitions:
   CREATE DATABASE PARTITION GROUP mixng12 ON DBPARTITIONNUM (1,2)
or
   CREATE DATABASE PARTITION GROUP mixng12 ON DBPARTITIONNUMS (1 TO 2)

The CREATE DATABASE command or sqlecrea() API also create the default system database partition groups, IBMDEFAULTGROUP, IBMCATGROUP, and IBMTEMPGROUP.

Before you begin

The computers and systems must be available and capable of handling a partitioned database environment. You have purchased and installed DB2® Enterprise Server Edition. The database must exist.