Converting a nonpartitioned table space to an index-controlled partitioned table space
Use the following procedure to convert a nonpartitioned table space into an index-controlled partitioned table space. You can also add a clustering, partitioning index and limit keys for the additional partitions.
In this example, a base table exists in the nonpartitioned table space. This task also provides instructions for creating a clustering index for an existing base table and creating a partitioning index.
In this task, you perform the following subtasks:
- Display the list of table space partitions.
- Specify the additional partitions.
- Create the clustering, partitioning index for the base table.
To display the list of table space partitions
- On the BMC AMI Change Manager for Db2 Main Menu, select WORKID, and press Enter.
- On the WORKID Action Menu, type the name of the WORKID or type a wildcard pattern to display a list of work IDs. Then, select Specify Db2 definitions and press Enter.
- On the Object Specification panel, specify the name of a nonpartitioned table space (or use wildcard characters). Then, press Enter.
- On the Mixed List panel, type PT in the Act column adjacent to the nonpartitioned table space that you want to modify.
To specify the additional partitions
- On the Tablespace Parts List panel, specify whether the table space will be a regular partitioned table space or a large partitioned table space.
- In the Dssize field, specify the maximum size for each partition or data set.
- In the Segsize field, type 0.
- For VCAT-defined table spaces, specify whether the table space should use a variable control interval size (CISIZE):
- Type Y to use a CISIZE that is equal to the page size of the table space.
- Type N to use a CISIZE of 4 KB, regardless of the page size.
- Leave the Variable CISIZE field blank to have the product use the value of the Db2 subsystem parameter DSNZPARM to create the VSAM data sets.
Type I in the Act column adjacent to the existing partition. Then, press Enter.A blank line is inserted after the line on which you typed I.
Type the name of the Stogroup or VCAT and specify values for the following fields:
Field
Description
Volume
The first volume upon which a VCAT partition resides
PriQty
The primary quantity for the partition
SecQty
The secondary quantity for the partition
Aloc Unit
The allocation unit for the partition
Free Page
The page increment for inserting a free page
Pct Free
The percentage of free space to leave on each nonleaf page
Gbp Cach
The group buffer pool cache setting for the partition
Comp
The compression attribute for the partition
SMS Storclass
For VCAT partitions, the SMS storage class for the partition
SMS Dataclass
For VCAT partitions, the SMS data class for the partition
SMS Mgmtclass
For VCAT partitions, the SMS management class for the partition
Track Mod
The indicator for tracking page modifications in the space map pages
- Repeat Step 4 and Step 5 for each partition that you want to create.
- Press END.
To create the clustering, partitioning index for the base table
Before you create the clustering, partitioning index for the base table, determine if such an index already exists for the table. You can have only one clustering, partitioning index for the table. If a clustering, partitioning index exists, perform one of the following actions:
- Determine whether you want to use the existing index or create a new index. If you choose to create a new index by following the steps in this section, you must delete the existing index.
- Create additional partitions for the existing index on the Index Parts List panel. Do not follow the steps in this section to create the index.
- On the Mixed List panel, type CIX in the Act column adjacent to the base table. Then, press Enter.
On the Create Index panel, specify the attributes for the index.
- Specify the owner of the index.
- Specify the name of the index.
- Type Y to indicate that the index is a clustering index.
- Type S to select Keys and TB Cols.
Press Enter.The Index Key Mixed List panel is displayed, as shown in the following figure.
ALUSIXKX R ---------------------- Index Key Mixed List ----------------------
Command ===> Scroll. .
WORKID . . . . : RDACRJ.ALT01 Commands: CANCEL END
(C)opy columns from the list under TABLE COLUMNS up to make a list under
INDEX KEY. Use (A)fter/(B)efore to position columns under INDEX KEY.
Objects 1 to 3 of 3
More:
Act Colname Column Type UDT Length Nl FP
************************************ TOP **************************************
A INDEX KEY . . . : RDACRJ IX_PART_02
TABLE COLUMNS . : RDACRJ T_L13SS
ROW_ID ROWID N N
C OTRACOL CHAR 5 N N
CLOB CLOB Y N
*********************************** BOTTOM ************************************
Specify the index key.
- Type C in the Act column adjacent to the column name.
- Type A in the Act column adjacent to the Index Key.
Press Enter.The Index Key Mixed List panel is displayed as shown in the following figure. The index key column is displayed below the index key.
ALUSIXKX R ---------------------- Index Key Mixed List ----------------------
Command ===> Scroll. .
WORKID . . . . : RDACRJ.ALT01 Commands: CANCEL END
(C)opy columns from the list under TABLE COLUMNS up to make a list under
INDEX KEY. Use (A)fter/(B)efore to position columns under INDEX KEY.
Objects 1 to 4 of 4
More:
Act Colname Column Type UDT Length Nl FP
************************************ TOP **************************************
INDEX KEY . . . : RDACRJ IX_PART_02
L 1 OTRACOL A
TABLE COLUMNS . : RDACRJ T_L13SS
ROW_ID ROWID N N
L OTRACOL CHAR 5 N N
CLOB CLOB Y N
*********************************** BOTTOM ************************************- Press END.
- On the Create Index panel, type S to select Partitions.
- On the Index Parts List panel, select Partitioned for the partitioning status.
Type I in the Act column adjacent to a partition. Then, press Enter.A blank line is inserted after the line on which you typed I.
Type the name of the Stogroup or VCAT and specify values for the following fields:
Field
Description
Volume
The first volume upon which a VCAT partition resides
PriQty
The primary quantity for the partition
SecQty
The secondary quantity for the partition
Aloc Unit
The allocation unit for the partition
Free Page
The page increment for inserting a free page
Pct Free
The percentage of free space to leave in each nonleaf page
Gbp Cach
The group buffer pool cache setting for the partition
SMS Storclass
For VCAT partitions, the SMS storage class for the partition
SMS Dataclass
For VCAT partitions, the SMS data class for the partition
SMS Mgmtclass
For VCAT partitions, the SMS management class for the partition
Limitkey
The limit key value for the partition
Press END.The Create Index panel is displayed. The panel indicates the number of partitions.
- Press END until the WORKID Action Menu is displayed.
Where to go from here