Nonstop Database, HiRDB Version 9 System Operation Guide
This example reorganizes a row-partitioned table (TABLE1) by table. The conditions for this reorganization are as follows:
- TABLE1 is row-partitioned in user RDAREAs (RDAREA1 and RDAREA2).
- A row partitioning index (INDEX1) and a non-partitioning key index (INDEX2) are defined for TABLE1.
- INDEX1 is row-partitioned in user RDAREAs (RDAREA3 and RDAREA4).
- INDEX2 is stored in a user RDAREA (RDAREA5).
- The indexes are created in the batch mode (default) when the table is reorganized.
- The table is reorganized in the pre-update log acquisition mode (default).
Note: The shaded data will be reorganized.
- Procedure
- Use the pdhold command to shut down the RDAREAs to be reorganized.
- Create a control statements file for the pdrorg command.
- Use the pdrorg command to reorganize the table.
- Back up the RDAREAs that were reorganized.
- Use the pdrels command to release the shutdown status of the RDAREAs.
- The procedure step numbers correspond to the paragraph numbers in the explanation that follows. For example, step 3 above is explained in paragraph (3) below.
- Hint
-
- Because you are using the pdrorg command in the pre-update log acquisition mode, you must make a backup after executing the pdrorg command, as described in step 4.
- Because you are using the pdrorg command in the pre-update log acquisition mode, keep the RDAREAs being reorganized in shutdown status from step 1 through step 4.
- Organization of this subsection
- (1) Use the pdhold command to shut down RDAREAs to be reorganized
- (2) Create the control statements file for the pdrorg command
- (3) Use the pdrorg command to reorganize the table
- (4) Back up the RDAREAs that were reorganized
- (5) Use the pdrels command to release RDAREAs from shutdown status
(1) Use the pdhold command to shut down RDAREAs to be reorganized
pdhold -r RDAREA1,RDAREA2,RDAREA3,RDAREA4,RDAREA5
|
(2) Create the control statements file for the pdrorg command
The following are the contents of the control statements file (/pdrorg/rorg01):
unload /pdrorg/unfile1 1
idxwork /pdrorg/idxwork 2
sort /sortwork 3
|
- Explanation
- Specifies the name of the unload data file.
- Specifies the name of the directory in which an index information file is to be created. The index information file is created under this directory.
- Specifies the name of the work directory for sorting.
(3) Use the pdrorg command to reorganize the table
pdrorg -k rorg -t TABLE1 /pdrorg/rorg01
|
- Explanation
- Because two indexes (INDEX1 and INDEX2) are to be re-created simultaneously in the batch mode, the -i option is omitted and the indexes are created in the batch index creation mode.
- -k: Specifies rorg for reorganization.
- -t: Specifies the name of the table that is to be reorganized.
- /pdrorg/rorg01: Specifies the name of the control statements file for the pdrorg command created in step (2).
(4) Back up the RDAREAs that were reorganized
(5) Use the pdrels command to release RDAREAs from shutdown status
pdrels -r RDAREA1,RDAREA2,RDAREA3,RDAREA4,RDAREA5
|
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.
All Rights Reserved. Copyright (C) 2011, 2015, Hitachi, Ltd.