Nonstop Database, HiRDB Version 9 System Operation Guide

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

13.6.1 Preparations for adding a column

Organization of this subsection
(1) Notes on adding a column to a table with the FIX attribute
(2) Notes

(1) Notes on adding a column to a table with the FIX attribute

A column cannot be added to a table with the FIX attribute in which data is stored. If it is necessary to add a column to a table with the FIX attribute in which data is stored, you must use the following procedure.

Procedure
  1. Use the pdrorg command to unload the table data.
  2. Use the PURGE TABLE statement to delete the table data.
  3. Use the ALTER TABLE statement to add a column.
  4. Use the pdhold command to shut down RDAREAs storing the table.
  5. Use the pdload command to load the table data.
  6. Use the pdlogswap -d sys -w command to swap the system log files.
  7. Use the pdcopy command to make a backup. For details about making backups, see 6. Backup Procedures.
  8. Use the pdrels command to release the RDAREAs from shutdown status.

Notes
  1. Either DAT or binary format can be used for unloading the table's data in step 1. It is preferable to use DAT format because it is a simpler operation.
  2. If the table contains character data that cannot be converted to DAT format (0x00 and 0x0a), the table data cannot be unloaded in DAT format; binary format must be used in such a case.
  3. For an example of unloading a table in DAT format, see 13.6.6 Example 5: Adding a column to a table with the FIX attribute (unloading in DAT format).
  4. For an example of unloading a table in binary format, see 13.6.7 Example 6: Adding a column to a table with the FIX attribute (unloading in binary format).

(2) Notes