13.3.6 Example 6: Reorganizing data dictionary tables

This example reorganizes data dictionary tables that are stored in the data dictionary RDAREA (DATADIC) and in a data dictionary LOB RDAREA (DATALOB). Reorganize the dictionary table in the pre-update log acquisition mode (default).

Procedure
  1. Use the pdhold command to shut down the data dictionary RDAREA and data dictionary LOB RDAREA.
  2. Back up the data dictionary RDAREA and the data dictionary LOB RDAREA.
  3. Create a control statements file for the pdrorg command.
  4. Use the pdrorg command to reorganize the dictionary table.
  5. Back up the data dictionary RDAREA and the data dictionary LOB RDAREA.
  6. Use the pdrels command to release the data dictionary RDAREA and data dictionary LOB RDAREA 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 pre-update log acquisition mode, keep the data dictionary RDAREA and data dictionary LOB RDAREA being reorganized in shutdown status from steps 1 through 5.
Organization of this subsection
(1) Use the pdhold command to shut down the data dictionary RDAREA and data dictionary LOB RDAREA
(2) Back up the data dictionary RDAREA and the data dictionary LOB RDAREA
(3) Create the control statements file for the pdrorg command
(4) Use the pdrorg command to reorganize the data dictionary table
(5) Back up the data dictionary RDAREA and the data dictionary LOB RDAREA
(6) Use the pdrels command to release the data dictionary RDAREA and data dictionary LOB RDAREA from shutdown status
(7) Note

(1) Use the pdhold command to shut down the data dictionary RDAREA and data dictionary LOB RDAREA

You will be backing up the RDAREAs while they are in shutdown status. After you have backed them up, keep the RDAREAs in shutdown status so that other users do not update their contents.

pdhold -r DATADIC,DATALOB

(2) Back up the data dictionary RDAREA and the data dictionary LOB RDAREA

To be prepared for the possibility that the RDAREAs will prove to be too small during reorganization, back up the data dictionary RDAREA and the data dictionary LOB RDAREA. If the size of the data dictionary RDAREA or the data dictionary LOB RDAREA becomes insufficient during reorganization, you will have to be able to recover the RDAREAs from a backup. For details about backing up RDAREAs, see 6.4.6 Example 6 (Backing up RDAREAs).

(3) 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
lobunld /pdrorg/unfile2                      2

Explanation
  1. Specifies the name of the unload data file for the data dictionary RDAREA.
  2. Specifies the name of the unload data file for the data dictionary LOB RDAREA.

(4) Use the pdrorg command to reorganize the data dictionary table

pdrorg -k rorg -c dic /pdrorg/rorg01

Explanation
-k: Specifies rorg in order to execute reorganization.
-c: Specifies that a data dictionary table is to be reorganized.
/pdrorg/rorg01: Specifies the name of the control statements file for the pdrorg command created in step (3).

(5) Back up the data dictionary RDAREA and the data dictionary LOB RDAREA

Back up the data dictionary RDAREA and the data dictionary LOB RDAREA (DATADIC and DATALOB). For details about backing up RDAREAs, see 6.4.6 Example 6 (Backing up RDAREAs).

(6) Use the pdrels command to release the data dictionary RDAREA and data dictionary LOB RDAREA from shutdown status

pdrels -r DATADIC,DATALOB

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.

(7) Note

Exercise caution if the following error occurs during the reorganization of a dictionary table:

In such a case, use the procedure explained below to reorganize the dictionary table.

Procedure
  1. Using the backup made before reorganizing, execute the database recovery utility to recover the data dictionary RDAREA and the data dictionary LOB RDAREA.
  2. Use the database reorganization utility to expand or add the data dictionary RDAREA and the data dictionary LOB RDAREA.
  3. Reorganize the dictionary table again.
    Using the unload data file created before the error occurred (before the RDAREAs were expanded or added), perform everything but reloading.