Hitachi

Hitachi Advanced Database Command Reference


16.6 Notes

  1. Because the adbidxrebuild command uses SQL statements to retrieve table data, we recommend that you execute the command in an environment in which out-of-order execution is applied. For details about environments in which out-of-order execution is applied, see Database retrieval method (out-of-order execution) in the HADB Setup and Operation Guide.

  2. Use X'0A' (LF) or X'0D0A' (CRLF) for the line break code in any file specified in the options of the adbidxrebuild command.

  3. Index rebuild processing continues even if there is a duplicated key value in a unique index (B-tree index for the primary key or B-tree index for which UNIQUE was specified in the CREATE INDEX statement). The KFAA61205-W warning message indicating detection of duplicate key values is issued. In such a case, the table and the B-tree index subject to index rebuild processing violate the uniqueness constraint. Locate the duplicate key values and delete the corresponding rows (a B-tree index that violates the uniqueness constraint is in the status called uniqueness constraint violation). Then re-execute the adbidxrebuild command and rebuild the corresponding B-tree index.

  4. Use the adbcancel command to cancel execution of the adbidxrebuild command. If you want to use anything other than the adbcancel command, use a method such as the adbstop --force command or the OS's kill command to forcibly terminate the server process. After canceling the adbidxrebuild command, re-execute the adbidxrebuild command as needed based on the explanation in 16.5 Handling abnormal termination of the adbidxrebuild command.

    For details about how to use the adbcancel command to suspend an executing command, see 1.6 When suspending (forcibly terminating) an executing command.

  5. Index rebuild processing is executed in server processes. Therefore, using the Ctrl+C keys to forcibly terminate the adbidxrebuild command process will not interrupt index rebuild processing that is being performed by server processes (this processing continues). When the index rebuild processing is completed, the command outputs the KFAA81001-I message to the message log file.

  6. Work files (temporary work files) are created during index rebuild processing. These temporary work files are deleted automatically when the adbidxrebuild command terminates normally (the return code is 0 or 4). If the adbidxrebuild command does not terminate normally, these work files might not be deleted.

    Because some of the temporary work files will be needed when the re-execute facility is used, do not delete temporary work files before you use the re-execute facility. If you do delete them, the re-execute facility will not function correctly.

  7. Because temporary work files might cause a shortage of disk space, we recommend that you delete temporary work files from time to time in the following cases:

    • There will no need to re-execute the adbidxrebuild command.

    • There is no need to re-execute the adbimport command.

    Check the following directories periodically for any remaining work files and delete any that are found:

    • $DBDIR/ADBSYS/ADBUTL

    • Temporary work file storage directories specified in the -w option (or in $DBDIR/ADBWORK when the -w option was omitted)

  8. The following table shows how index creation processing is inherited from the adbimport command.

    Table 16‒7: Inheriting index creation processing from the adbimport command

    No.

    Canceled command#1

    Command to be executed following cancelation

    Whether processing is inherited

    Command name

    Option specification

    --create-temp-file option

    --force option

    1

    adbimport

    adbidxrebuild

    Specified

    Not specified

    Y#2, #3

    2

    Not specified

    Specified

    Y#2, #4, #5

    3

    Not specified

    Not specified

    N

    Legend:

    Y: Index creation processing can be inherited.

    N: Index creation processing cannot be inherited. (The KFAA50201-E message is issued.)

    #1

    To identify the canceled command, output the table summary information by executing the adbdbstatus command. The name of the command that was canceled is output to the Rerun_command column in the output results. For details about the adbdbstatus command, see 13. adbdbstatus (Analyze the Database Status).

    If the adbidxrebuild command executed after the cancelation of the adbimport command is canceled, adbidxrebuild is displayed in the Rerun_command column. If the --create-temp-file option was specified for the canceled adbidxrebuild command, re-execute the adbidxrebuild command with the --create-temp-file option specified. In this case, the information about the cancelation of the adbimport command is saved in a command status file (file under the $DBDIR/ADBSYS/ADBUTL directory), and therefore indexes are rebuilt for the chunk that was being processed when the adbimport command was canceled.

    #2

    Executing the adbidxrebuild command rebuilds all indexes that were defined for the table to be processed. The -i option of the adbidxrebuild command is ignored even if it is specified.

    #3

    If the KFAA50247-E message is issued during re-execution of the adbimport command (no temporary work file exists), execute the adbidxrebuild command with the --create-temp-file option specified. In this way, index creation processing can be inherited.

    #4

    When an index is defined for the table to be processed while the adbimport command is stopped, and the KFAA50209-E message is issued during re-execution of the adbimport command (an index in unfinished status exists), you can inherit index creation processing by executing the adbidxrebuild command with the --force option specified.

    To identify the indexes in unfinished status, output the index summary information by executing the adbdbstatus command, and check the Unfinished column in the output results. If an index is in unfinished status, unfinished is output to the Unfinished column in the output results. For details about the adbdbstatus command, see 13. adbdbstatus (Analyze the Database Status).

    If the adbimport command has not been canceled, execute the adbidxrebuild command without the --force option specified.

    #5

    If the KFAA50244-E message is issued while the adbimport command is stopped (no command status file exists), execute the adbidxrebuild command with the --force option specified. In this way, index creation processing can be inherited.

  9. Note the following if the adbidxrebuild command is executed and canceled after cancelation of the adbimport command:

    • When the adbidxrebuild command with the --create-temp-file option specified is canceled after cancelation of the adbimport command

      If you re-execute the adbidxrebuild command, the command resumes index rebuild processing at the point of table retrieval in the chunk for which processing was canceled even if you do not specify the --create-temp-file option. Note, however, that if you specify the --force option when you re-execute the adbidxrebuild command, specification of the --force option goes into effect.

    • When the adbidxrebuild command with the --force option specified is canceled after cancelation of the adbimport command

      If you re-execute the adbidxrebuild command, index rebuild processing is forcibly re-executed from the beginning even if you do not specify the --force option. Therefore, even if you specify the --create-temp-file option when you execute the command, the option is ignored. When index rebuild processing is forcibly re-executed from the beginning, the KAFF80215-I message is issued.

  10. Make sure that there is no duplication of the absolute paths for the directories and files specified in the adbidxrebuild command's options. This applies to the following directories and files:

    • Temporary work file storage directories (specified in the -w option or specified in the directory path file specified in the -w option)

    • Directory path files specifying the storage locations of temporary work files (specified in the -w option)

    • Index identifier file (specified in the -i option)

    • Index rebuild option file (specified in the -z option)

    Make sure that the absolute paths of these directories and files are unique from those of any file names used by any programs other than the adbidxrebuild command. If a duplicate file name is used, data in the file might be corrupted. Also make sure that symbolic links and relative paths are specified correctly.

  11. If the adbidxrebuild command is executed while another command or application program is running, HADB might not be able to allocate the required number of processing real threads. If this happens, HADB waits until the required number of processing real threads can be allocated before executing the adbidxrebuild command. If allocation of processing real threads is placed in wait status, see the topic Points to consider about the number of processing real threads to be used during command execution in Points to consider when executing commands concurrently in Preparing Resources in the HADB Setup and Operation Guide and take appropriate action.

  12. To reduce this command's execution time, see the topic Reducing the execution time of the adbidxrebuild command in Tuning to shorten command execution time in Tuning in the HADB Setup and Operation Guide.

  13. Do not delete a user who is executing the adbidxrebuild command or revoke such a user's REBUILD INDEX privilege while indexes are being rebuilt. If the executing user is deleted or the user's privileges are revoked by mistake and the adbidxrebuild command terminates abnormally, it is not possible to use the re-execute facility provided by the adbidxrebuild command.

    If the executing user is deleted or the user's privileges are revoked by mistake, take either of the following corrective actions:

    • As the same user, make the adbidxrebuild command executable, and then re-execute this command. For details about the corrective action to take, see the topic Managing HADB users or Managing access privileges in Unscheduled Operations in the HADB Setup and Operation Guide.

    • As a different user who has REBUILD INDEX privileges for the table to be processed, execute the adbidxrebuild command with the --force option specified.