Hitachi

Hitachi Advanced Database Setup and Operation Guide


15.9.1 Steps to take when unfinished status is applied to a B-tree index

If you define a B-tree index for a base table to which segments for storing rows are assigned, that B-tree index is placed in unfinished status (a status in which no B-tree index data can be created). For details about the status in which segments for storing rows are assigned, see 5.3.1 Notes on defining B-tree indexes (unfinished status of B-tree indexes).

When a B-tree index is placed in unfinished status, the following operations end in an error.

■ Operations that end in an error
  • Executing a SELECT statement that uses an unfinished B-tree index

  • Executing the INSERT, UPDATE, or DELETE statement on a table for which an unfinished B-tree index is defined

  • Executing the adbimport command without the -d option specified on a base table for which an unfinished B-tree index is defined

  • Executing the adbmergechunk command on a base table for which an unfinished B-tree index is defined

  • Executing the adbunarchivechunk command on an archivable multi-chunk table for which a B-tree index in unfinished status is defined

Note

The TRUNCATE TABLE statement can be executed. If the TRUNCATE TABLE statement is used to delete all rows from a base table, B-tree index data is also deleted, and therefore, the B-tree index is released from unfinished status.

A B-tree index is placed in unfinished status for the following reasons:

The way you release a B-tree index from unfinished status depends on the cause of the unfinished status.

Organization of this subsection

(1) If you define a B-tree index for a base table to which segments for storing rows are assigned

  1. Check whether the B-tree index is in unfinished status.

    You can use the adbdbstatus command to check whether a B-tree index is in unfinished status. See 10.9.3 Checking the status and usage of a B-tree index.

    If the B-tree index is in unfinished status, proceed to step 2.

  2. Release the B-tree index from unfinished status.

    Execute the adbidxrebuild command on the base table for which the unfinished B-tree index is defined.

    Rebuilding a B-tree index by executing the adbidxrebuild command releases the B-tree index from unfinished status.

    If the CREATE INDEX statement is executed after the adbimport command has terminated abnormally, B-tree indexes might be placed in unfinished status. In this case, execute the adbidxrebuild command with the --force option specified. If the adbidxrebuild command is executed without the --force option specified, an error will result.

    For details about the adbidxrebuild command, see adbidxrebuild (Rebuild Indexes) in the manual HADB Command Reference.

(2) When the adbimport or adbidxrebuild command has terminated abnormally

  1. Check whether the B-tree index is in unfinished status.

    You can use the adbdbstatus command to check whether a B-tree index is in unfinished status. See 10.9.3 Checking the status and usage of a B-tree index.

    If the B-tree index is in unfinished status, proceed to step 2.

  2. Release the B-tree index from unfinished status.

    If the adbimport or adbidxrebuild command terminates abnormally, re-execute the respective command on the base table for which the unfinished B-tree index is defined.

    When the re-executed adbimport or adbidxrebuild command terminates normally, the B-tree index is released from unfinished status.