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
-
-
If an access error occurred on a command status file (file under the $DBDIR/ADBSYS/ADBUTL directory) and the KFAA50244-E message was issued, re-execute the adbidxrebuild command with the --force option specified. (In this case, index rebuild processing is executed from the beginning.)
For details about how to execute the adbidxrebuild command with the --force option specified, see (2) Executing the adbidxrebuild command with the --force option specified in 16.5.6 If an error occurs during re-execution of the adbidxrebuild command.
-
If an access error occurred on a temporary work file (the KFAA50247-E message is issued), re-execute the adbidxrebuild command with the --create-temp-file option specified. (In this case, index rebuild processing is executed from the point of table data retrieval.)
For details about how to execute the adbidxrebuild command with the --create-temp-file option specified, see (1) Executing the adbidxrebuild command with the --create-temp-file option specified in 16.5.6 If an error occurs during re-execution of the adbidxrebuild command.
-
- 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.
When canceled#1 |
||
---|---|---|
During table data retrieval processing |
During sort processing |
While creating B-tree and text indexes#2 |
|
|
- #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.
- #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
-
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)
-
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)