Hitachi

Hitachi Advanced Database Command Reference


16.5.3 If the target table is a single-chunk table

If you are rebuilding a B-tree index defined for a single-chunk table (including a B-tree index corresponding to the primary key) or a text index, you might be able to use the re-execute facility of the adbidxrebuild command. This facility resumes index rebuild processing from the point of B-tree and text index creation processing.

Organization of this subsection

(1) Notes before re-execution

The re-execute facility is applied automatically when the adbidxrebuild command is re-executed by the same HADB user who executed the adbidxrebuild command that terminated abnormally. No special operation is needed.

If you want to change command options or index rebuild options when you re-execute the adbidxrebuild command, see 16.5.5 Changing command options and index rebuild options during re-execution.

Important

(2) Whether the re-execute facility is applied (for a single-chunk table)

The table below describes whether the re-execute facility is applied depending on when the adbidxrebuild command was canceled.

Note that the database recovery method is the same regardless of when cancellation occurred.

Table 16‒3: Whether the re-execute facility is applied depending on when the adbidxrebuild command was canceled (for a single-chunk table)

When canceled#1

During table data retrieval processing

During sort processing

While creating B-tree and text indexes#2

Whether the re-execute facility is applied

Not applied.#3

Table status

One of the following:

  • Non-updatable

  • Status before the adbidxrebuild command was executed

Index status

B-tree, text, and range indexes are in one of the following statuses:

  • Unfinished status

  • Status before the adbidxrebuild command was executed

Whether the re-execute facility is applied

Applied.#4

Table status

Non-updatable

Index status

B-tree and text indexes are in unfinished status.

Range indexes have been rebuilt (range indexes have been released from unfinished status).

#1

You can determine when the command was canceled by the messages that are issued, as shown in the following:

[Figure]

#2

If the KFAA80204-I message has been issued with return code 0 or 4, index rebuild processing has been completed. In such a case, there is no need to re-execute the adbidxrebuild command.

If the KFAA80204-I message has not been issued, execute the command shown below and check line 2 in the output results (table summary information) (line 1 in the output results contains the column titles).

adbdbstatus -c table -n name-of-table-for-which-adbidxrebuild-command-was-canceled

Specify name-of-table-for-which-adbidxrebuild-command-was-canceled in the format schema-name.table-identifier.

■ When the value of the Command_status column (column 17) is abort and the value of the Rerun_command column (column 18) is adbidxrebuild

[Figure]

Index rebuild processing was not completed. Re-execute the adbidxrebuild command.

■ When no values are displayed in the Command_status column (column 17) and the Rerun_command column (column 18)

[Figure]

Index rebuild processing has been completed. There is no need to re-execute the adbidxrebuild command.

#3

When the adbidxrebuild command is re-executed, index rebuild processing will be restarted from the beginning.

However, if all indexes to be rebuilt are deleted before the adbidxrebuild command is re-executed, only command termination processing is performed.

#4

When the adbidxrebuild command is re-executed, the command resumes index rebuild processing from the point of B-tree and text index creation processing.

In the following cases, the command resumes index rebuild processing from the point of table data retrieval:

  • The adbidxrebuild command is executed with the --create-temp-file option specified

  • After the adbimport command is stopped, the adbidxrebuild command executed with the --create-temp-file option specified is canceled

In addition, if all indexes to be rebuilt are deleted before the adbidxrebuild command is re-executed, only command termination processing is performed.