Hitachi

Hitachi Advanced Database Command Reference


16.5.4 If the target table is a multi-chunk table

If you are rebuilding indexes defined for a multi-chunk table, you can use the re-execute facility of the adbidxrebuild command to restart index rebuild processing with the chunk that was being processed when the previous processing was canceled.

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.

Make sure that you do not change the -i option when you re-execute the adbidxrebuild command. If you want to change other 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
Note

The chunk ID of the chunk where index rebuild processing was started is displayed in the KFAA80211-I message, and the chunk ID of the chunk where the processing was completed is displayed in the KFAA80212-I message.

(2) Restart processing (for a multi-chunk table)

If you are rebuilding indexes defined for a multi-chunk table, the location where the processing is restarted when the adbidxrebuild command is re-executed depends on when the adbidxrebuild command was canceled.

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

Table 16‒4: Restart processing depending on when the adbidxrebuild command was canceled (for a multi-chunk table)

When canceled#1

During table data retrieval processing

During sort processing

While creating B-tree and text indexes#2

Processing at the restart

Index rebuild processing is restarted from the point of table data retrieval for the chunk where the previous processing was canceled.#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

Processing at the restart

Index rebuild processing resumes from the point of building the B-tree and text indexes of the chunk in which processing stopped.#4

Table status

Non-updatable

Index status

B-tree, text, and range indexes are in unfinished status.

If the command was canceled while it was processing the final chunk,#5 the range index has been rebuilt (the range index is released from unfinished status).

#1

You can determine when the command was canceled by the messages that are issued, as shown below. The KFAA80211-I through KFAA80212-I messages are output for each chunk ID of the table.

[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

If the adbidxrebuild command was canceled while it was retrieving table data from the first chunk, the index rebuild processing is restarted from the beginning when the adbidxrebuild command is re-executed (the re-execute facility is not applied).

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

#4

In the following cases, index rebuild processing resumes from the point of table data retrieval in the chunk in which processing stopped:

  • The adbidxrebuild command is re-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.

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

#5

To determine whether the adbidxrebuild command was canceled while it was processing the final chunk for the target table, check the KFAA80211-I message to see whether the current chunk ID value is the same as the total number of chunks.

Example of the KFAA80211-I message (when the command was canceled while it was processing the final chunk for the target table)

KFAA80211-I Processing for the chunk will start. (chunk id = 3) (3/3)