Nonstop Database, HiRDB Version 9 System Operation Guide

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

13.3.7 Example 7: Reorganizing in no-log mode

This example reorganizes a row-partitioned table (TABLE1) by table. The conditions for this reorganization are as follows:

Note: The data indicated by shading is subject to reorganization.

Procedure
  1. Use the pdhold command to shut down the RDAREAs to be reorganized.
  2. Back up the RDAREAs to be reorganized.
  3. Create a control statements file for the pdrorg command.
  4. Use the pdrorg command to reorganize the table.
  5. Back up the RDAREAs that were reorganized.
  6. Use the pdrels command to release the RDAREAs from shutdown status.
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 no-log mode, you must make a backup before you execute the pdrorg command. This backup will be used to recover the RDAREAs if the pdrorg command terminates abnormally. However, you need not make this backup if certain conditions are met. For details about these conditions, see 13.2.3(3) Conditions under which a backup is not needed before reorganizing.
  • Because you are using the pdrorg command in the no-log mode, you must make a backup after executing the pdrorg command, as described in step 5.
  • Because you are using the pdrorg command in the no-log mode, keep the RDAREAs being reorganized in shutdown status from steps 1 through 5.
Organization of this subsection
(1) Use the pdhold command to shut down RDAREAs to be reorganized
(2) Back up the RDAREAs to be reorganized
(3) Create the control statements file for the pdrorg command
(4) Use the pdrorg command to reorganize the table
(5) Back up the RDAREAs that were reorganized
(6) 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
 

(2) Back up the RDAREAs to be reorganized

Back up the RDAREAs to be reorganized (RDAREA1 to RDAREA4). For details about backing up RDAREAs, see 6.4.8 Example 8 (backing up specified RDAREAs).

(3) Create the control statements file for the pdrorg command

The following are the contents of the control statements file (/pdrorg/rorg01):

(a) HiRDB single server configuration
 
unload /pdrorg/unfile1                        1
idxwork /pdrorg/idxwork                       2
sort /sortwork                                3
 

Explanation
  1. Specifies the name of the unload data file.
  2. 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.
  3. Specifies the name of the work directory for sorting.
(b) HiRDB parallel server configuration
 
unload bes1:/pdrorg/unfile1                  1
idxwork bes1 /pdrorg/idxwork                 2
sort bes1 /sortwork                          3
unload bes2:/pdrorg/unfile2                  4
idxwork bes2 /pdrorg/idxwork                 5
sort bes2 /sortwork                          6
 

Explanation
  1. Specifies the name of the unload data file (for bes1).
  2. Specifies the name of the directory in which an index information file is to be created (for bes1). The index information file is created under this directory.
  3. Specifies the name of the work directory for sorting (for bes1).
  4. Specifies the name of the unload data file (for bes2).
  5. Specifies the name of the directory in which an index information file is to be created (for bes2). The index information file is created under this directory.
  6. Specifies the name of the work directory for sorting (for bes2).

(4) Use the pdrorg command to reorganize the table

 
pdrorg -k rorg -t TABLE1 -l n /pdrorg/rorg01
 

Explanation
To re-create the index (INDEX1) at the same time, the -i option is omitted and the index batch creation mode is used.
-k: Specifies rorg in order to execute reorganization.
-t: Specifies the name of the table to be reorganized.
-l: Specifies the no-log mode (n).
/pdrorg/rorg01: Specifies the name of the control statements file for the pdrorg command created in step (3).

(5) Back up the RDAREAs that were reorganized

Back up the RDAREAs that were reorganized (RDAREA1 to RDAREA4). For details about backing up RDAREAs, see 6.4.8 Example 8 (backing up specified RDAREAs).

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

 
pdrels -r RDAREA1,RDAREA2,RDAREA3,RDAREA4
 

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.