13.15.2 Example 2 (changing from hash partitioning to key range partitioning)

The procedure described below can be used to change the row partitioning method from key range partitioning to hash partitioning. This procedure can be used only when no change is made to the structure of the columns containing the partitioning key.

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 DROP TABLE statement to delete TABLE01
(5) Use the CREATE TABLE statement to redefine the partitioning method for TABLE01
(6) Use the CREATE INDEX statement to redefine the index
(7) Use the pdhold command to shut down RDAREAs to be reloaded
(8) Use the pdrorg command to reload data into TABLE01
(9) Back up the RDAREAs in which data was reloaded
(10) 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 -j -t TABLE01 -g /pdrorg/unld02

Explanation
-k: Specifies unld for unloading.
-j: Specifies that a LOB column or a column with the LOB attribute is defined in the table that is to be unloaded.
-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. Specifying the -g option consolidates the unload data files (into a single file).
/pdrorg/unld02: Specifies the name of the control information file for the pdrorg command.

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

pdrels -r RDAREA01,RDAREA02,...

(4) Use the DROP TABLE statement to delete TABLE01

DROP TABLE TABLE01;

(5) Use the CREATE TABLE statement to redefine the partitioning method for TABLE01

CREATE TABLE TABLE01 ... ;

(6) Use the CREATE INDEX statement to redefine the index

CREATE INDEX INDX01 ... ;

(7) Use the pdhold command to shut down RDAREAs to be reloaded

pdhold -r RDAREA01,RDAREA02,...

(8) Use the pdrorg command to reload data into TABLE01

pdrorg -k reld -j -t TABLE01 -g /pdrorg/reld02

Explanation
-k: Specifies reld for reloading.
-j: Specifies that a LOB column or a column with the LOB attribute is defined in the table that is to be reloaded.
-t: Specifies the name of the table that is to be reloaded.
-g: If the -g option was specified in step (2), specify it here as well.
/pdrorg/reld02: Specifies the name of the control information file for the pdrorg command.

(9) Back up the RDAREAs in which data was reloaded

Because you reloaded data in the pre-update acquisition mode (default), back up the RDAREAs in which data was reloaded. For details about backing up RDAREAs, see 6.4.6 Example 6 (Backing up RDAREAs).

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

pdrels -r RDAREA01,RDAREA02,...

It is recommended that after the command has executed you check whether or not the execution results are correct. For details on how to check command execution results, see the manual HiRDB Version 8 Command Reference.