pdorbegin (Commit a database for online reorganization)

Function

The pdorbegin command places specified original RDAREAs and replica RDAREAs of a specified generation in the replica group in online reorganization hold status.

When a table is specified, the command processes all RDAREAs related to that table and places each original RDAREA and the specified generation of replica RDAREAs in the replica group in online reorganization hold status. For details about related RDAREAs, see pdrdrefls. To also process the related areas in the constraint definition, specify the -c option. For details, see the description of the -c option.

Once you execute the pdorbegin command, any transaction that accesses an RDAREA in the replica group that contains the specified original RDAREA is placed in wait status until the pdorchg command has executed.

To release online reorganization hold status, specify the -u option.

You can execute the pdorbegin command only when HiRDB Staticizer Option has been installed and the pd_max_reflect_process_count and pd_inner_replica_control operands have both been specified in the system definition.

Executor

HiRDB administrator

Format

Format 1 (for placing RDAREAs in online reorganization hold status and releasing them from this status):

 pdorbegin {-r original-RDAREA-name[,original-RDAREA-name]...

            |-t [authorization-identifier.]table-identifier

                [-s server-name[,server-name]...][-c constraint-type]}

          [-q generation-number ] [-w lock-release-wait-time] [-e] [-u]

Format 2 (for releasing a shared RDAREA or a shared table from online reorganization hold status (applicable to a HiRDB/Parallel Server only)):

 pdorbegin {-r original-RDAREA-name[,original-RDAREA-name]...

            |-t [authorization-identifier.]table-identifier[-c constraint-type]}

          [-s server-name[,server-name]...]

          [-q generation-number ] [-w lock-release-wait-time] -u

Options

Specifies the names of RDAREAs that are to be placed in online reorganization hold status.

Rules
  1. Specify user RDAREAs and user LOB RDAREAs. An error results if any other type of RDAREA is specified.
  2. An error results if all replica RDAREAs have been deleted or there is no replica RDAREA for a specified RDAREA. If a batch specification of RDAREA names is used and it includes an original RDAREA whose replica RDAREAs have all been deleted or an RDAREA without a replica RDAREA, the command ignores the batch specification of RDAREA names and resumes processing.
  3. If you duplicate an RDAREA name, the command eliminates the RDAREA from processing.
  4. You can use a batch specification of RDAREA names to specify original RDAREA names. When a batch specification of RDAREA names is used, the command ignores any original RDAREA whose replica RDAREAs have all been deleted or any regular RDAREA without a replica RDAREA and then resumes processing. The command can process a maximum of 4,096 RDAREAs by means of a batch specification of RDAREA names. For details about batch specification of RDAREA names, see 1.5.2 Batch specification of RDAREA names in operation commands.
  5. You can specify a maximum of 128 RDAREA names. If more than 128 RDAREA names are specified, an error occurs. When a batch specification of RDAREA names is used, a maximum of 4,096 RDAREAs can be processed.
  6. If an RDAREA name is enclosed in double quotation marks ("), the system treats it as being case sensitive; otherwise, the system treats it as all uppercase letters. If an RDAREA name contains a space, enclose the entire name in double quotation marks ("). If you are using sh (Bourne shell), csh (C shell), or ksh (Korn shell), you must enclose the entire set of RDAREA names in single quotation marks (').

[Figure]<identifier> ((authorization identifier: 1-8, table identifier: 1-30))

Specifies the name of a table that is to be placed in online reorganization hold status.

The command processes the RDAREAs related to the specified table and places each original RDAREA and the specified generation of replica RDAREAs in the replica group in online reorganization hold status.

When the -t option is specified, the number of RDAREAs storing the specified table must not exceed 4,096.

When the authorization identifier is omitted, the pdorbegin command assumes the authorization identifier set in the PDUSER environment variable at the time of execution. If the PDUSER environment variable has not been set, the command assumes the user name specified in the logon window.

If the authorization identifier or table identifier is enclosed in double quotation marks ("), the command treats it as being case sensitive. If it is not enclosed in double quotation marks ("), the command treats it as in all uppercase letters. If you are using sh (Bourne shell), csh (C shell), or ksh (Korn shell), you must enclose the entire identifier in single quotation marks (').

Specifies servers for which the processing is to be performed. The following guidelines apply to specifying the -s option:

Rules
  1. When this option is omitted, the command processes all servers that contain the RDAREAs to be processed.
  2. If a shared RDAREA is to be placed in online reorganization hold status, specify the -s option together with the -u option because all back-end servers must be processed in the batch mode. When the -u option is omitted, specifying the -s option results in an error.
  3. You can specify a maximum of 128 server names. Specifying more than 128 server names results in an error.

Specifies the generation number of the replica RDAREAs in the replica group that are to be placed in online reorganization hold status.

You cannot specify 0, which is the generation number of original RDAREAs.

Specifies the lock-release wait time in seconds for the online reorganization hold.

When this option is omitted, the command assumes the value of the pd_lck_wait_timeout operand in the system definition. If the value of the pd_lck_wait_timeout operand is 0 in the system definition, the command assumes 3,600.

Specifies that online reorganization hold is to be released. When this option is specified, the -r and -t options must also be specified.

When the processing target includes a shared RDAREA, processing is performed at all back-end servers in the batch mode. If it is not possible to release all the target RDAREAs from online reorganization hold status, an error results. If the shared RDAREA needs to be released from online reorganization hold status for each server for reasons such as a specific back-end server being inactive, you can specify the -s option to release the online reorganization hold.

When you release online reorganization hold, you must specify the same resources as when the processing target was placed in online reorganization hold status (otherwise, an error occurs). The following table shows the relationships between the options specified when the processing target was placed in online reorganization hold status and the options that are specified when it is released from online reorganization hold status:

pdorbegin command options when online reorganization hold is releasedpdorbegin command options when the processing target was placed in online reorganization hold status
-r RDAREA-t table-t table -c ref
-r RDAREA -uY#NN
-t table -uNYN
-t table -c refNNY
Legend:
Y: Can be executed
N: Cannot be executed (results in an error)
# If multiple RDAREAs were placed in online reorganization hold status, there is no need to specify all the RDAREAs in the -r option of the pdorbegin command when they are being released from online reorganization hold status.

Specifies that the associated RDAREAs in the constraint definition are also to be placed in online reorganization hold status. When you specify this option, you must also specify the -t option. Specifying this option without specifying the -t option results in an error.

ref
Specifies that RDAREAs associated with referential constraints are also to be placed in online reorganization hold status. This refers to RDAREAs that contain a referencing table or a referenced table that must be handled together with generation numbers. For details about how to handle referential constraints, see the manual HiRDB Version 8 Installation and Design Guide.

Specifies that only the updated columns are to be applied during reflection processing for online reorganization when the pdorend command is executed. For notes about the -e option specification, see the manual HiRDB Staticizer Option Version 7 Description and User's Guide.

Rules

  1. The pdorbegin command can be executed only while HiRDB is active.
  2. The pdorbegin command must be executed at the server machine that contains the single server or where the system manager is located.
  3. When you execute the pdorbegin command, the data dictionary RDAREA must be in one of the following statuses:
    • Open and shutdown release status
    • Open and command shutdown status
  4. The pdorbegin command processing depends on option specifications, as described below:
    • When the -r option is specified
      The pdorbegin command processes the specified original RDAREAs for each server. If the command is unable to place all the specified original RDAREAs and the specified generation of replica RDAREAs in the replica group in online reorganization hold status, processing for the corresponding server results in an error and the command processes the next server.
    • When the -t option is specified
      The related RDAREAs for the specified table are processed, and each original RDAREA and the specified generation of replica RDAREAs in the replica group are placed in online reorganization hold status. Because all applicable servers are processed in the batch mode, all servers are placed in the same status.
  5. If the server with a specified original RDAREA contains an RDAREA that has already been placed in online reorganization hold status, the pdorbegin command results in an error.
  6. Whether or not the pdorbegin command is executable depends on the status of the original RDAREA. For details, see C.1 RDAREA status transitions. A replica RDAREA must be in command shutdown and closed status.
  7. The pdorbegin command results in an error if a reflection status management table has not been created by the pdorcreate command or a reflection status management table has been created for an original RDAREA specified in the -r option.
  8. If the column recovery restriction specified during table definition is not ALL and the -r option specifies a user LOB RDAREA that contains that table (LOB column), execution of the command for the server containing that user LOB RDAREA will result in an error.
  9. When the processing target includes a shared RDAREA, processing is performed at all back-end servers in the batch mode. Therefore, an error occurs if the command is unable to place all the specified original RDAREAs and the specified generation of replica RDAREAs in the replica group in online reorganization hold status.
  10. When the pdorbegin command is executed, deadlock may occur for a referencing or updating transaction. By specifying pd_deadlock_priority_use=Y in the system definition and a deadlock priority value for the operation command in the pd_command_deadlock_priority operand, you can specify whether the referencing or updating transaction or the operation command is to take control in the event of deadlock. To make the pdorbegin command result in an error, specify a larger deadlock priority value for the operation command. In this case, re-execute the pdorbegin command after a specific period of time because the pdorbegin command results in an error after releasing all the locks that were placed by the command. To give precedence to the pdorbegin command and make the referencing or updating transaction result in an error, specify a smaller deadlock priority value for the operation command.
  11. If the server contains both shared and non-shared RDAREAs that are in online reorganization hold status and you specify the -s option to release online reorganization hold, you must execute the processing for the shared RDAREAs separately from the processing for the non-shared RDAREAs. If an attempt is made to execute the processing for both at the same time, an error results.
  12. Whether or not the pdorbegin command can be executed and the execution range depend on the processing target (table or RDAREA) and the combination of options (t, -r, -s, and -u), as described below:
    Processing targetOptionWhether or not executableExecution rangeCommand execution format
    -t-r-s-u-c
    TableNon-partitioned table (including shared tables for HiRDB/Single Server)S[Figure][Figure][Figure][Figure]YAll related RDAREAs2Format 1
    S[Figure][Figure]S[Figure]Y
    S[Figure]S[Figure][Figure]Y1RDAREAs related to the specified back-end server2
    S[Figure]SS[Figure]Y1
    S[Figure][Figure][Figure]SYAll related RDAREAs3
    S[Figure][Figure]SSY
    S[Figure]S[Figure]SY1All RDAREAs related to the specified back-end server3
    S[Figure]SSSY1
    Row-partitioned tableS[Figure][Figure][Figure][Figure]YAll related RDAREAs2
    S[Figure][Figure]S[Figure]Y
    S[Figure]S[Figure][Figure]Y1RDAREAs related to the specified back-end server2
    S[Figure]SS[Figure]Y1
    S[Figure][Figure][Figure]SYAll related RDAREAs3
    S[Figure][Figure]SSY
    S[Figure]S[Figure]SY1All RDAREAs related to the specified back-end server3
    S[Figure]SSSY1
    Shared table (applicable to a HiRDB/Parallel Server only)S[Figure][Figure][Figure][Figure]YRDAREAs related to all back-end servers2
    S[Figure][Figure]S[Figure]YFormat 2
    S[Figure]S[Figure][Figure]NNot applicableFormat 1
    S[Figure]SS[Figure]YRDAREAs related to the specified back-end server2Format 2
    S[Figure][Figure][Figure]SYRDAREAs related to all back-end servers3Format 1
    S[Figure][Figure]SSYFormat 2
    S[Figure]S[Figure]SNNot applicableFormat 1
    S[Figure]SSSYRDAREAs related to the specified back-end server3Format 2
    RDAREANon-shared RDAREA only[Figure]S[Figure][Figure][Figure]YOnly the specified RDAREAsFormat 1
    [Figure]S[Figure]S[Figure]Y
    [Figure]SS[Figure][Figure]NNot applicable
    [Figure]SSS[Figure]N
    [Figure]S[Figure][Figure]SN
    Shared RDAREA only[Figure]S[Figure][Figure][Figure]YAll back-end servers
    [Figure]S[Figure]S[Figure]YFormat 2
    [Figure]SS[Figure][Figure]NNot applicableFormat 1
    [Figure]SSS[Figure]YSpecified back-end serversFormat 2
    [Figure]S[Figure][Figure]SNNot applicableFormat 1
    Both non-shared and shared RDAREAs[Figure]S[Figure][Figure][Figure]YAll back-end serversFormat 1
    [Figure]S[Figure]S[Figure]YFormat 2
    [Figure]SS[Figure][Figure]NNot applicableFormat 1
    [Figure]SSS[Figure]NFormat 2
    [Figure]S[Figure][Figure]SNFormat 1
    Legend:
    S: Option is specified
    [Figure]: Option is omitted
    Y: Can be executed
    N: Cannot be executed
    1
    If the specified back-end server does not match the back-end server that contains the related RDAREAs, an error occurs.
    2
    Relation to the constraint definition is not included.
    3
    Relation to the constraint definition is included.

Notes

  1. The result of the pdorbegin command can be checked with the pdls -d org command or on the basis of the return code. The return codes are as follows:
    0: Normal termination
    4: Warning termination (processing was successful at some servers)
    8: Abnormal termination
    12: Abnormal termination (an event occurred that prevented the command from displaying an error message)
    If the return code is 12, check the error message in syslogfile at the host where the single server or dictionary server is located, eliminate the cause of the error, and then re-execute the command. If no error message has been output to syslogfile, contact the customer engineer.
  2. The online reorganization hold is inherited when HiRDB is restarted.
  3. The pdorbegin command places the specified RDAREAs in the EX lock mode. If a specified RDAREA is being accessed by another transaction, the pdorbegin command is placed in wait status until that transaction terminates. Once execution of pdorbegin command begins, all transactions for the specified RDAREAs are placed in wait status due to a lock on the replica group configuration until the pdorchg command is completed.
  4. When the -t option is specified, the pdrdrefls command executes internally. Therefore, when the -t option is specified, a message from the pdrdrefls command may be displayed.