13.1 Overview

The integrity check utility (pdconstck) performs integrity checking and manipulates (sets or releases) the check pending status on tables for which referential constraints or check constraints have been defined.

Organization of this section
(1) Prerequisites
(2) Authorization identifier during execution of pdconstck

(1) Prerequisites

(a) Operating conditions

The table below describes the prerequisites for executing pdconstck.

Table 13-1 Prerequisites for executing pdconstck

ItemPrerequisites
Execution privilegeA user with the DBA privilege or the subject table's owner can execute the utility.
RDAREA statusFor details about the relationship between pdconstck and the status of an RDAREA to be processed, see C. RDAREA Status During Command Execution.
Concurrent executionOnly one instance of pdconstck can be executed on the same table at the same time. If multiple instances of pdconstck are executed concurrently, deadlock may occur between the subject table's TABLE resource type (resource type 0002) and DICT resource type (resource type 3005).
Multiple instances of pdconstck can be executed concurrently as long as there is no duplication among the target tables. However, when the check pending status is changed, the utility is placed in lock-release wait status.
Maximum number of utilities that can be executed concurrentlyThe maximum number of instances of pdconstcks that can be executed concurrently is equal to the value of the pd_max_users operand/2.
Number of resourcesBecause pdconstck locks the target table and a referenced table that is referenced by a foreign key, you must pay attention to the following values in the system definition:
  • Number of base tables that can be accessed concurrently
    In the pd_max_access_tables operand in the system definition, specify a value that is at least (number of foreign keys for the target table + 1).
  • Sum of the number of locked tables and the number of RDAREAs for which UNTIL DISCONNECT is specified per server
    In the pd_lck_until_disconnect_cnt operand in the system definition, specify a value that is at least the value of X in the following formula:
    X = (2 + number of foreign keys for the target table + number of RDAREAs that store the target table + total number of RDAREAs that store the table whose primary key is referenced by the foreign keys)
  • Lock pool size per server
    In the pd_lck_pool_size operand in the system definition, specify a value that is at least [Figure]Y[Figure]x[Figure].
In a HiRDB single server configuration:
Y = 209 + A + f + (a + c + (d[Figure] b)) [Figure] e
In a HiRDB parallel server configuration:
[Figure] Dictionary server
Y = 209 + A + (a + c + (d[Figure] b)) [Figure] e
[Figure] Front-end server
Y = 2 + f
[Figure] Back-end server
Y = (d[Figure] b) [Figure] e
Legend:
a: Number of table storage RDAREAs
b: Number of index storage RDAREAs
c: Number of LOB column storage RDAREAs
d: Number of indexes
e: Number of generations that have replica RDAREAs
f: Number of plug-ins defined for the target table and the table whose primary key is referenced by foreign keys
x: 6 for 32-bit mode HiRDB, 4 for 64-bit mode HiRDB
A: MAX (number of columns in the table, number of indexes for the table, number of table storage RDAREAs, number of foreign keys for the table, number of check constraints for the table)
Change of check pending statusExecuting pdconstck changes the check pending status, regardless of the specification of the pd_check_pending operand in the system definition.
Inner replica facilityIf you use the inner replica facility, make sure that all RDAREAs associated with the target table (table storage RDAREAs, LOB column storage RDAREAs, and index storage RDAREAs) have the same number of replica definitions. Also, make sure that all the replica RDAREAs are of the same generation. If the target table is a referencing table, pdconstck can be executed on the RDAREAs that are related to the table referenced by the referencing table even if its replica definition is different from that for the corresponding table.
  1. Target table
    [Figure]If all the replica RDAREAs related to the target table are generations that are in command shutdown and closed status, the table is not subject to processing.
    [Figure]If the target table is partitioned among multiple servers and the local server contains no replica RDAREAs, the local server processes the current RDAREA.
  2. Table (referenced table) that is referenced by the target table (referencing table)
    [Figure]If all generations are subject to processing, and if the generation of the replica RDAREAs related to the referenced table that is referenced by the target table (referencing table) is different from the generation of the replica RDAREA that corresponds to the target table, integrity checking is performed on the current RDAREA.
    [Figure]If an individual generation is subject to processing and the specified generation does not contain a replica RDAREA related to the referenced table that is referenced by the referencing table, integrity checking is performed on the current RDAREA.
    [Figure]If the generation of the current RDAREA is subject to processing, integrity checking is performed on the current RDAREA for the referenced table that is referenced by the referencing table.
(b) Operating environment

The table below describes the operating environment for pdconstck.

Table 13-2 Operating environment for pdconstck

ItemOperating environment
HiRDB environmentLocation of command executionExecute pdconstck at the server machine that contains the single server, or where the system manager is located.
Server statusWhen you execute pdconstck, the following server(s) must be running:
In a HiRDB single server configuration: Single server
In a HiRDB parallel server configuration: Dictionary server, front-end server, and back-end server (in the case of multiple front-end servers, at least one of them must be running)
PDDIR environment variableIn the PDDIR environment variable, set the absolute path name of the HiRDB directory.
PDCONFPATH environment variableIn the PDCONFPATH environment variable, set the absolute path name of the directory that stores the HiRDB system definition files.
OS environmentLANG environment variableIn the LANG environment variable, set the value appropriate for the character encoding specified in the pdsetup command. You must specify the PDLANG environment variable if you are using a character encoding that is not supported by the OS.
For details about the LANG and PDLANG settings, see the HiRDB Version 9 UAP Development Guide.
File and directory specified in the -o optionAccess privileges must have been granted to the user who executes pdconstck.
If the -o option was omitted, access privileges must be granted in the same manner; otherwise, the system assumes that files are to be created in the directory shown in Table 13-3 Directory to which files are output by pdconstck.

Table 13-3 Directory to which files are output by pdconstck

-o optionpd_tmp_directory operand in the system definition
SpecifiedOmitted
TMPDIR environment variable#
SpecifiedOmitted
SpecifiedDirectory specified in the -o option
OmittedDirectory specified in pd_tmp_directoryDirectory specified in TMPDIR/tmp directory
#: Environment variable specified in the command execution environment

(2) Authorization identifier during execution of pdconstck

When you execute pdconstck, you can specify the authorization identifier used to connect to HiRDB as well as the authorization identifiers for the target table and the constraint name. The table below shows the authorization identifier used to connect to HiRDB and the authorization identifiers for the target table or constraint name.

Table 13-4 Authorization identifier used to connect to HiRDB and authorization identifiers for the target table and constraint name

Specification conditionConnection with HiRDBAuth identifier for the target table or constraint name
Auth identifier used to connect to HiRDB (-u option)PDUSER environment variableAuth identifier for target table or constraint name (-t or -c option)Auth identifierPassword
Auth identifierPassword
SpecifiedSpecifiedSpecifiedSpecifiedAuthorization identifier specified in the -u optionEntered in response to a message#Authorization identifier specified in the -t or -c option
Not specifiedAuthorization identifier specified in the -u option
OmittedSpecifiedAuthorization identifier specified in the -t or -c option
Not specifiedAuthorization identifier specified in the -u option
PDUSER environment variable omittedSpecifiedAuthorization identifier specified in the -t or -c option
Not specifiedAuthorization identifier specified in the -u option
Not specifiedSpecifiedSpecifiedSpecifiedAuthorization identifier specified in the PDUSER environment variablePassword specified in the PDUSER environment variableAuthorization identifier specified in the -t or -c option
Not specifiedAuthorization identifier specified in PDUSER environment variable
OmittedSpecifiedOmittedAuthorization identifier specified in the -t or -c option
Not specifiedAuthorization identifier specified in PDUSER environment variable
PDUSER environment variable omittedSpecifiedUser name (authorization identifier) in the login windowEntered in response to a message#Authorization identifier specified in the -t or -c option
Not specifiedUser name (authorization identifier) in the login window
Legend:
Auth: Authorization
#: A message requesting entry of a password is displayed. Enter the appropriate password as the response to this message. If NULL is entered as the response, the system assumes that no password was set.