Nonstop Database, HiRDB Version 9 System Operation Guide

[Contents][Index][Back][Next]

13.10.3 Example 3: Increasing the number of row partitions in a table with FIX hash partitioning

This example increases the number of row partitions for table TABLE01 from 2 to 3. Its index (INDEX01) is partitioned likewise. TABLE01 is FIX hash partitioned.

It is assumed that this table does not use the hash facility for hash row partitioning. When this hash facility is used, an RDAREA can be added with an ALTER TABLE statement even if the table contains data. Consequently, there is no need to unload and load the table data. For an example of the hash facility for hash row partitioning, see 13.11 Increasing the number of table row partitions (using the hash facility for hash row partitioning).

[Figure]

Organization of this subsection
(1) Use the pdhold command to shut down RDAREAs to be unloaded
(2) Use the pdrorg command to unload data from TABLE01
(3) Use the pdrels command to release RDAREAs from shutdown status
(4) Use the PURGE TABLE statement to delete TABLE01's data
(5) Use the ALTER TABLE statement to add RDAREA03 to TABLE01
(6) Use the pdhold command to shut down the RDAREAs into which data is to be loaded
(7) Use the pdload command to load data into TABLE01
(8) Back up the RDAREAs in which data was loaded
(9) Use the pdrels command to release RDAREAs from shutdown status

(1) Use the pdhold command to shut down RDAREAs to be unloaded

 
pdhold -r RDAREA01,RDAREA02,...
 

(2) Use the pdrorg command to unload data from TABLE01

 
pdrorg -k unld -W bin -t TABLE01 -g /pdrorg/unld02
 

Explanation
-k: Specifies unld for unloading.
-W bin: Specifies that the unload data file is to be used as the input file (binary format) for the pdload command.
-t: Specifies the name of the table that is to be unloaded.
-g: Specifies that TABLE01 is row-partitioned between servers in a HiRDB parallel server configuration. Specifying the -g option consolidates the unload data files (into a single file).
/pdrorg/unld02: Specifies the name of the control statements file for the pdrorg command.

(3) Use the pdrels command to release RDAREAs from shutdown status

 
pdrels -r RDAREA01,RDAREA02,...
 

(4) Use the PURGE TABLE statement to delete TABLE01's data

 
PURGE TABLE TABLE01;
 

To increase the number of row partitions in a table with FIX hash partitioning, the data in the table must be deleted.

(5) Use the ALTER TABLE statement to add RDAREA03 to TABLE01

 
ALTER TABLE TABLE01 ADD RDAREA RDAREA03;
 

(6) Use the pdhold command to shut down the RDAREAs into which data is to be loaded

 
pdhold -r RDAREA01,RDAREA02,...
 

(7) Use the pdload command to load data into TABLE01

 
pdload -b -W TABLE01 /pdload/load02
 

Explanation
-b: Specifies that binary data is to be loaded.
-W: Specifies that binary format input data created by the pdrorg command is to be used.
TABLE01: Specifies the name of the table into which data is to be loaded.
/pdload/load02: Specifies the name of the control statements file for the pdload command.

(8) Back up the RDAREAs in which data was loaded

Because you loaded data in the pre-update acquisition mode (default), back up the RDAREAs in which data was loaded. For details about backing up RDAREAs, see 6.4.8 Example 8 (backing up specified RDAREAs).

(9) Use the pdrels command to release RDAREAs from shutdown status

 
pdrels -r RDAREA01,RDAREA02,...
 

We recommend that after the command has executed you check whether the execution results are correct. For details on how to check command execution results, see the manual HiRDB Version 9 Command Reference.