Nonstop Database, HiRDB Version 9 System Operation Guide

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

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 an error might occur during reorganization, back up the data dictionary RDAREA and the data dictionary LOB RDAREA. If the size of either of these RDAREAs becomes insufficient during reorganization of the dictionary table needed for RDAREA extension, you must be able to recover the RDAREA from a backup since the RDAREA cannot be extended. If a unit goes down during reorganization of the dictionary table, you must also be able to recover the RDAREA from a backup since the front-end server cannot reference the dictionary table during HiRDB startup, and goes into SUSPEND status. For details about how to determine whether the RDAREA needs to be recovered from a backup, see the conditions described below in (7) Note.

(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.8 Example 8 (backing up specified RDAREAs).

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

 
pdrels -r DATADIC,DATALOB
 

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.

(7) Note

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

In such a case, take appropriate action according to whichever of the conditions listed below is applicable.

Condition 1:
When the database reorganization utility is executed in the update log acquisition mode or the pre-update log acquisition mode, and reloading of the SQL_PHYSICAL_FILES table and the SQL_RDAREAS table has been completed:
  1. Use the database structure modification utility to expand or add the dictionary RDAREA and the data dictionary LOB RDAREA.
  2. Without changing the option or control statement specification, re-execute the database reorganization utility.

Condition 2:
When the database reorganization utility is executed in the update log acquisition mode or the pre-update log acquisition mode, and reloading of the SQL_PHYSICAL_FILES table and the SQL_RDAREAS table has not been completed, or when the database reorganization utility is executed in the no-log mode:
  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.

In such a case, take the following actions:

  1. Using the backups acquired before the reorganization and the database recovery utility, restore the data dictionary RDAREA and the data dictionary LOB RDAREA.
  2. Use the pdstart -a command to start HiRDB.
    For details, see 1.3.3 Startup procedure used when the front-end server is in SUSPEND status due to an error in a data dictionary RDAREA (pdstart -a).