Nonstop Database, HiRDB Version 9 System Operation Guide

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

13.13.11 Handling when referential constraint and check constraint are used

Organization of this subsection
(1) Changing the partitioning storage conditions of a referenced table
(2) Changing partitioning storage conditions for a referencing table
(3) Changing partitioning storage conditions for a table for which check constraint has been defined

(1) Changing the partitioning storage conditions of a referenced table

When a partitioning storage condition is changed, table data might be deleted. Consequently, when the partitioning storage conditions of a referenced table are changed, matching between the referenced table and the referencing table cannot be guaranteed.

When WITHOUT PURGE can be used during splitting, table data will not be deleted. However, as explained in 13.13.10(2) Recovery procedure when data not satisfying the post-splitting storage condition remains, if data remains that does not match the storage conditions after the partitioning storage conditions have been changed, that data cannot be retrieved. As a result, a mismatch occurs between this data and the data in the referencing table. The following shows an example:

[Figure]

Explanation:
  1. In this example, R03 for the referenced table contains the data 2004-12-30 and this data also exists in the referencing table. Therefore, the referential constraint is satisfied.
  2. If WITHOUT PURGE is specified, the data 2004-12-30 remains in R03 that is to store the data 2001-12-31 through 2002-12-31. In this case, the referenced table cannot be searched for the data 2004-12-30, and the referential constraint is not satisfied.

If pd_check_pending=USE is specified in the system definition and the partitioning storage condition is changed for a referenced table, the referencing table is placed in check pending status regardless of whether WITHOUT PURGE is specified. If pd_check_pending=NOUSE is specified, the referencing table is placed in non-check pending status. Therefore, if you have changed the partitioning storage conditions, you must check the table's integrity and release the table from check pending status. For details, see the HiRDB Version 9 Installation and Design Guide.

(2) Changing partitioning storage conditions for a referencing table

The following describes the operation when partitioning storage conditions are changed for a referencing table.

(3) Changing partitioning storage conditions for a table for which check constraint has been defined

The following describes the operation when partitioning storage conditions are changed for a table for which check constraint has been defined.