Hitachi

Hitachi Advanced Database Setup and Operation Guide


11.17.4 Reorganization of a system table and lock control

This subsection describes the relationship between the adbreorgsystemdata command and lock control, and the wait status of the adbreorgsystemdata command.

Organization of this subsection

(1) Relationship between the adbreorgsystemdata command and lock control

When you execute the adbreorgsystemdata command, the HADB server reserves locked resources according to the explanation in 2.10.4 Locked resources that are reserved and their lock modes.

While the adbreorgsystemdata command is being executed, the system-table DB area, which is a locked resource, is reserved in exclusive mode (EX). Therefore, you cannot execute the adbimport and adbmergechunk commands.

If any of the following SQL statements or command is being executed, the adbreorgsystemdata command is placed in wait status. (The KFAA80257-I message is output, and then reorganization processing is interrupted.) After the SQL statement or command that is being executed finishes, the processing for the adbreorgsystemdata command is resumed.

SQL statements and command that place the adbreorgsystemdata command in wait status
  • Retrieval SQL statement (that is executed on a system table (base table) or an archivable multi-chunk table#)

  • Update SQL statement (that is executed on an archivable multi-chunk table#)

  • adbexport command (that is executed on a system table (base table) or an archivable multi-chunk table#)

  • adbdbstatus command with the --shared-lock option specified (executed for the system-table DB area)

  • adbdbstatus command with the --shared-lock option specified (executed for the system table (base table) that is the target of adbreorgsystemdata command processing)

  • adbdbstatus command with the --shared-lock option specified (executed for an index of the system table (base table) that is the target of adbreorgsystemdata command processing)

#

This case includes when the adbreorgsystemdata command is executed on the system table (base table) STATUS_CHUNKS. If you execute the adbreorgsystemdata command on a system table (base table) other than the STATUS_CHUNKS table, the adbreorgsystemdata command is not placed in wait status even while the preceding SQL statement or command is being executed on an archivable multi-chunk table.

If you want to release the wait status of the adbreorgsystemdata command without waiting for the SQL statement or command to finish, see (2) Releasing the wait status of the adbreorgsystemdata command in 11.17.4 Reorganization of a system table and lock control.

(2) Releasing the wait status of the adbreorgsystemdata command

If you want to release the wait status of the adbreorgsystemdata command without waiting for the SQL statement or command that causes the wait status to finish, you need to terminate the SQL statement or command.

To terminate the SQL statement or command that causes the wait status of the adbreorgsystemdata command, perform the following procedure.

Procedure:

  1. Execute the adbls -d lock command.

    Check the item CID of the following row:

    • The row in which the ID of the table on which the adbreorgsystemdata command is executed is output to the item RESOURCEID

    For details about the ID of the system table (base table) targeted by the adbreorgsystemdata command, see (1) List of system tables in C.1 System table overview.

  2. Execute the adbls -d cnct command.

    Check the item CID of either of the following rows:

    • The row in which command is output to the item CLIENT_TYPE and the time output to the item CONNECT_TIME is earlier than the time the KFAA80256-I message was output. (This message was output as the result of the previous execution of the adbreorgsystemdata command.)

    • The row in which command is not output to the item CLIENT_TYPE and which also satisfies the following condition. The execution time of the SQL statement that is determined based on the value (microseconds) output to the item SQL_ELAPSED_TIME is earlier than the time the KFAA80256-I message was output. (This message was output as a result of the previous execution of the adbreorgsystemdata command.)

  3. Execute the adbcancel command.

    The item CID that was checked in step 1 and step 2 indicates the connection ID of the SQL statement or command that caused the wait status of the adbreorgsystemdata command. If you execute the adbcancel command with the connection ID specified, the wait status of the adbreorgsystemdata command will be released.

For details about these commands, see the manual HADB Command Reference.