Hitachi

Hitachi Advanced Database Setup and Operation Guide


2.10.4 Locked resources that are reserved and their lock modes

The following table shows the locked resources that are reserved and their lock modes.

For details about each locked resource, see Table 2‒14: Locked resources. For examples of locks performed for each type of processing, see 2.10.7 Examples of locks.

Table 2‒15: Locked resources that are reserved and their lock modes

Processing

Locked resources

Single connection#16

Dictionary

Pre-processing table

DB area

Table

Data DB area

Dictionary DB area

System-table DB area

Processing-target table

Dictionary table

System table (cost information)

System table (chunk information)

System table (synonym dictionary information)

Definition SQL execution

When a definition SQL statement other than the following SQL statements is executed

  • CREATE VIEW statement

  • ALTER VIEW statement

  • CREATE AUDIT statement

  • DROP AUDIT statement

--

EX (WAIT)

EX

EX

SR

SR

EX

EX

SR

SR#2

--

When the CREATE VIEW statement is executed

--

EX (WAIT)

EX#1

--

SR

SR

--

SR (WAIT) and EX#14

SR

--

SR

When the ALTER VIEW statement is executed

--

EX (WAIT)

SR (WAIT) and EX#1, #18

--

SR

SR

--

SR (WAIT) and EX#14

SR

--

SR

When the CREATE AUDIT statement or DROP AUDIT statement is executed

--

EX (WAIT)

EX

EX

SR

SR

--

EX

SR

--

--

Retrieval SQL execution

--

--

SR (WAIT)#3

--

--

--

SR (WAIT)#4, #5, #6

SR (WAIT)

SR

SR#7

SR

Execution of the INSERT, UPDATE, or DELETE statement

Table being updated

--

--

SR (WAIT)#3

SU#4, #5, #6

--

--

SU

SR (WAIT)

SR

SR#7

SR

Table not being updated

--

--

SR (WAIT)#3

--

--

--

SR (WAIT)#4, #5, #6

SR (WAIT)

SR

SR#7

SR

Execution of the TRUNCATE TABLE statement

--

--

SR (WAIT)

EX

--

SR#17

EX

SR (WAIT)

SR

SR#17

--

Execution of the PURGE CHUNK statement

Table being updated

--

--

SR (WAIT)

EX

--

SR

EX

SR (WAIT)

SR

SR#15

SR

Table not being updated#8

--

--

SR (WAIT)#3

--

--

--

SR

SR (WAIT)

SR

SR#15

SR

Execution of the adbimport command

When the background-import facility is used

SR

--

SR (WAIT)

PU

--

SR

SR (WAIT)

SR (WAIT)

SR

SR

--

When the background-import facility is not used

SR

--

SR (WAIT)

EX

--

SR#9

EX (WAIT)

SR (WAIT)

SR

SR#9

--

Execution of the adbidxrebuild command

When executed after background import processing was interrupted#10

SR

--

SR (WAIT)

EX

--

SR

SR (WAIT)

SR (WAIT)

SR

SR

--

When executed other than after background import processing was interrupted

SR

--

SR (WAIT)

EX

--

--

EX (WAIT)

SR (WAIT)

SR

--

--

Execution of the adbgetcst command

SR

--

SR (WAIT)

EX

--

SR

SR (WAIT)

SR (WAIT)

SR

--

--

Execution of the adbdbstatus command

When summary information for DB areas is output

SR

--

--

--

--

--

--

SR (WAIT)

--

--

--

When information is output by specifying the --shared-lock option or information about the need for reorganization is output

SR

--

SR#19

--

--

--

SR#19

SR (WAIT)

--

--

--

Other

SR

--

SR#19

EX

EX

EX

--

SR (WAIT)

SR

SR

--

Execution of the adbmodarea command

EX

--

--

--

--

--

--

SR (WAIT)

--

--

--

Execution of the adbexport command#11

SR

--

SR (WAIT)#3

--

--

--

SR (WAIT)

SR (WAIT)

SR

SR#7

SR

Execution of the adbmergechunk command

SR

--

SR (WAIT)

EX

--

SR

SU (WAIT)

SR (WAIT)

SR

SR

--

Execution of the adbchgchunkcomment command

SR

--

SR (WAIT)

EX

--

SR

SR (WAIT)

SR (WAIT)

SR

SR

--

Execution of the adbchgchunkstatus command

SR

--

EX (WAIT)

EX

--

SR

EX (WAIT)

SR (WAIT)

SR

SR

--

Execution of the adbarchivechunk command

SR

--

SR (WAIT) and EX (WAIT)#12, #13

SR and EX#12

--

SR

PU and EX (WAIT)#12, #13

SR (WAIT)

SR

SR

--

Execution of the adbunarchivechunk command

SR

--

SR (WAIT)

EX

--

SR

EX (WAIT)

SR (WAIT)

SR

SR

--

Execution of the adbreorgsystemdata command

SR

--

SR (WAIT)

--

--

EX

PU

SR (WAIT)

SR

--

--

Execution of the adbclientdefmang command

SR

--

--

--

--

--

--

SR (WAIT)

--

--

--

Execution of the adbsyndict command

When registering, updating, or deleting a synonym dictionary

SR

--

--

--

--

SR

--

--

--

--

SR

When synchronizing a synonym dictionary file, outputting a synonym list, or deleting unnecessary files

SR

--

--

--

--

--

--

--

--

--

SR

Execution of the adbaudittrail command

SR

--

--

--

--

--

--

SR (WAIT)

--

--

--

Execution of the adbconvertaudittrailfile command

SR

--

--

--

--

--

--

SR (WAIT)

--

--

--

Execution of the adbmodbuff command

SR

--

--

--

--

--

--

--

--

--

--

Legend:

--: Locked resources are not reserved.

EX: Locked resources are reserved in exclusive mode (EX).

PU: Locked resources are reserved in protected update mode (PU).

SU: Locked resources are reserved in shared update mode (SU).

SR: Locked resources are reserved in shared retrieval mode (SR).

WAIT: Stays in wait status until the locked resources can be reserved.

Note
#1

The locked resources are reserved in the shared retrieval mode (SR) for the underlying table of a viewed table. In this case, if the locked resources cannot be reserved, the transaction is placed in WAIT status until it can reserve the locked resources.

#2

The locked resources are reserved when the CREATE TABLE statement is executed to create a multi-chunk table and when the DROP TABLE statement is executed to delete a multi-chunk table.

The locked resources are also reserved when a definition SQL statement (such as DROP SCHEMA) is executed and, as a result of executing the statement, a multi-chunk table is deleted.

#3

If the processing-target table is an archivable multi-chunk table, the processing-target table and system table (STATUS_CHUNKS) are locked. Note, however, that this does not apply when the INSERT statement is executed for the processing-target table.

#4

If there is a ResultSet object that was created with HOLD_CURSORS_OVER_COMMIT specified for holdability within the same transaction, the locked resource is not released even if the transaction is committed. Committing the transaction after closing the ResultSet object releases the locked resource. Note that the locked resource is released if the transaction is rolled back.

#5

If an error occurs during execution of the SQL statement, the locked resources that were reserved by the transaction are not released until the transaction terminates.

#6

If an error occurs in a transaction that reserves multiple locked resources because of locked resource contention, the locked resources that had already been reserved before the error occurred are not released until the transaction terminates.

#7

The locked resources are reserved only if the processing-target table is an archivable multi-chunk table.

#8

This indicates the tables contained in a subquery when the PURGE CHUNK statement is executed with the subquery specified in the search condition.

#9

The locked resources are reserved only when the adbimport command with the -d or -m option specified is executed for a multi-chunk table.

#10

This is the case where the adbidxrebuild command is executed with the --create-temp-file option specified after the adbimport command to which the background-import facility was applied (with the -b option specified) has been interrupted.

#11

When the adbexport command is executed, a retrieval SQL statement is also executed as part of extended processing. Consequently, locked resources that are similar to those reserved by a retrieval SQL statement are also reserved.

#12

Transition of the lock mode occurs as a result of executing the adbarchivechunk command. After the lock mode changes, the locked resources are reserved in exclusive mode (EX).

#13

If transition of the lock mode occurs when the adbarchivechunk command is executed, the transition might cause a wait for reservation of the locked resources. If a wait occurs, other connections might reserve the locked resources first.

#14

The locked resources are reserved in shared retrieval mode (SR) during preprocessing. In this case, if the locked resources cannot be reserved, the transaction is placed in WAIT status until it can reserve the locked resources.

When the SQL statement is executed, the locked resources are reserved in exclusive mode (EX).

#15

If an archivable multi-chunk table is included in the tables that are not to be updated, the locked resources are reserved during preprocessing. In other cases, the locked resources are reserved when the SQL statement is executed.

#16

The locked resources are reserved when the relevant command is executed. The locked resources are also reserved when the application program connects to the HADB server. When the application program is connected to the HADB server, the locked resources are reserved in shared retrieval mode (SR).

#17

The locked resources are reserved only if the processing-target table is a multi-chunk table.

#18

The lock mode changes when the ALTER VIEW statement is executed. After the lock mode changes, the locked resources are reserved in exclusive mode (EX).

#19

If the target of the adbdbstatus command is an index, the lock is obtained for the table for which the index is defined.

If the target of the adbdbstatus command is a DB area, the lock is obtained for the tables stored in that DB area, and the tables stored in the DB area for which an index is defined.

The following explains how to interpret the above table using an example in which a retrieval SQL statement is executed.

When a retrieval SQL statement is executed

When a retrieval SQL statement is executed for an archivable multi-chunk table, the following locked resources are reserved in shared retrieval mode (SR):

  • Pre-processing table

  • Processing-target table

  • Dictionary table

  • System table (cost information)

  • System table (chunk information)

  • System table (synonym dictionary information)

Processing to reserve the preceding locked resources in shared retrieval mode (SR), shared update mode (SU), and protected update mode (PU) can be executed. For example, adbgetcst command can be executed.

However, processing to reserve the preceding locked resources in exclusive mode (EX) cannot be executed. For example, definition SQL statements and the TRUNCATE TABLE statement cannot be executed.