Hitachi

Hitachi Advanced Database Command Reference


33.2.1 Explanation of the specification format and options

Organization of this subsection

(1) Specification format

adbmergechunk
  -u authorization-identifier
  [-p password]
  [-g output-interval-for-merge-chunk-processing-progress-messages]
  [-w {temporary-work-file-storage-directory-name
       |name-of-directory-path-file-specifying-temporary-work-file-storage-locations}]
  [-z merge-chunk-option-file-name]
  [-m comment-to-be-set-in-chunk]
  [--purge-chunk {WAIT|NOWAIT}]
  -c {specification-of-merge-source-chunk-ID[,specification-of-merge-source-chunk-ID]...|ALL}
  table-to-be-processed
Important

You must specify the table to be processed as the last option that is specified.

(2) Explanation of options

-u authorization-identifier

~<character string>((1 to 100 bytes))

Specifies the authorization identifier of the HADB user who executes the adbmergechunk command. To execute the adbmergechunk command, the user must have the following two privileges:

  • CONNECT privilege

  • MERGE CHUNK privilege for the table to be processed

For this option, specify an authorization identifier in the range from 1 to 100 bytes. Note that the byte count (1 to 100 bytes) does not include the double quotation marks used to enclose the authorization identifier.

Important

If the character string used as the authorization identifier includes any lowercase letter or a backslash (\), make sure that you check the rules for specifying authorization identifiers. For the rules for specifying authorization identifiers, see 1.4.2 Rules for specifying authorization identifiers and passwords.

-p password

~<character string>((1 to 255 bytes))

Specifies the password for the authorization identifier that is specified in the -u option.

Important

If the password includes a character that has a special meaning in the OS or shell, such as a double quotation mark (") or vertical bar (|), make sure that you check the rules for specifying passwords. For the rules for specifying passwords, see 1.4.2 Rules for specifying authorization identifiers and passwords.

If the adbmergechunk command is executed with this option omitted, a message prompting the user to enter a password is displayed. In an environment in which a password cannot be entered from the standard input, such as when the command is executed in the background, make sure that you do not omit this option.

-g output-interval-for-merge-chunk-processing-progress-messages

~<integer>((0 to 1,000,000,000))<<0>>(in 1,000 rows)

Specifies the interval (in units of 1,000 rows) at which the merge chunk processing progress message is to be output. When this option is specified, the command outputs the number of rows of data that have been retrieved from the table whose indexes are being rebuilt to the progress message, in order to indicate the progress of the merge chunk processing.

For example, if 2 is specified in this option, the KFAA80205-I progress message is output each time 2,000 rows of table data have been retrieved to rebuild indexes.

If this option is omitted or 0 is specified in this option, the progress message is not output.

-w {temporary-work-file-storage-directory-name|name-of-directory-path-file-specifying-temporary-work-file-storage-locations}

~<OS path name>((2 to 518 bytes))

Specifies a storage location for the temporary work files that are created during merge chunk processing, expressed as either of the following:

  1. Absolute path name of the directory that stores temporary work files

  2. Absolute path name of a file (directory path file) that specifies directories for storing temporary work files

If frequent input/output operations are performed on the temporary work files stored under a single directory, performance might be adversely affected. We recommend that you use method 2 and store temporary work files in directories on multiple disks to distribute the workload of input/output operations on the disk. The following shows an example specification using method 2 (specifying a directory path file).

Example of directory path file

/mnt/diska/wwwww
/mnt/diskb/xxxxx
/mnt/diskc/yyyyy
/mnt/diskd/zzzzz

The following is a guideline for the number of directories to be specified:

Guideline-for-number-of-directories-to-be-specified = A × B

A: Maximum number of scan processing threads

Use the following formula to determine the value:

↓ (Value of the merge chunk option adb_mergechunk_rthd_num - 1) ÷ 2↓

B: Number of B-tree and text indexes that are defined for the table to be processed

If you do not know the number of B-tree and text indexes, check the number of B-tree and text indexes that are defined for the table by using the following SQL statement:

SELECT "N_INDEX"-"N_RANGE_INDEX"
    FROM "MASTER"."SQL_TABLES"
        WHERE "TABLE_SCHEMA"='authorization-identifier'
           AND "TABLE_NAME"='name-of-table-to-be-processed'
  • A maximum of 255 directories can be specified in a directory path file.

  • The directories specified in the directory path file are used as the storage locations of temporary work files in the order specified. When the last directory specified in the directory path file is used (in this example, /mnt/diskd/zzzzz), the first directory (in this example, /mnt/diska/wwwww) is then used again.

The following specification rules apply to this option (for both methods 1 and 2):

  • Do not specify a forward slash (/) at the end of a path name.

For details about how to estimate the sizes of the temporary work files that will be created under the directories specified in the -w option, see Estimating the size of the temporary work file for executing the adbmergechunk command in Estimating the size of the temporary work file for executing a command in Preparing Resources in the HADB Setup and Operation Guide. If this option is omitted, temporary work files are created under $DBDIR/ADBWORK.

It is advisable to provide a dedicated directory to store temporary work files. If a directory storing other files is used to store temporary work files, data in the existing files might be corrupted. Also make sure that symbolic links and relative paths are specified correctly. For details about the files whose names must differ from the temporary work file storage directory name, see 33.6 Notes.

If the disk that stores temporary work files runs out of free space, specify another disk with a larger capacity as the storage destination. For details about the actions to take if the disk that stores temporary work files runs out of free space, see Steps to take in the event of a shortage of disk space for storing temporary work files during command execution in Command-related problems in Troubleshooting in the HADB Setup and Operation Guide.

-z merge-chunk-option-file-name

~<OS path name>((2 to 510 bytes))

Specifies the absolute path name of the merge chunk option file that contains the merge chunk options. If this option is omitted, all merge chunk options are set to their default values because no merge chunk option file is specified.

For details about the merge chunk options, see 33.2.2 Format of merge chunk options.

Make sure that the merge chunk option name is unique from all other file names. If the merge chunk option file has the same name as another file, data in the file might become corrupted. For details about the files whose names must differ from the merge chunk option file name, see 33.6 Notes.

-m comment-to-be-set-in-chunk

~<character string>((1 to 1,024 bytes))

Specifies a comment that is to be set in the merge-target chunk.

The following rules apply to specifying this information:

  • The specified comment is case sensitive.

  • If the comment contains a character that has a special meaning in the OS or shell, such as a double quotation mark (") or vertical bar (|), specify the escape character (\) immediately before that character. Alternatively, enclose the entire comment in single quotation marks (').

    Example 1: -m abc\|def

    Example 2: -m 'abc|def'

    In both examples, abc|def is set as the comment.

  • If a character string is enclosed in double quotation marks (") and then the entire string is enclosed in single quotation marks ('), both the character string and the double quotation marks are treated as a comment.

    Example: -m '"abcdef"'

    In this example, "abcdef" is set as the comment.

  • The character encoding specified in the HADB server's ADBLANG environment variable is used for the character string set as a comment.

--purge-chunk {WAIT|NOWAIT}

Specifies whether the merge-source chunks are to be deleted after the merge-target chunk is created if processing of any another SQL statement or command references the table subject to merge chunk processing.

  • If WAIT is specified or this option is omitted

    Merge-source chunk deletion processing waits for the completion of processing of other SQL statements and commands that reference the table subject to merge chunk processing. The merge-source chunk deletion processing starts when there is no more processing that references the table subject to merge chunk processing. After the merge-source chunks are deleted, the adbmergechunk command terminates.

  • If NOWAIT is specified

    Merge-source chunk deletion processing is skipped. Therefore, the adbmergechunk command terminates while the merge-source chunks remain in the deletion-pending status.

    In this case, you need to delete the merge-source chunks manually. See the KFAA96785-E message to check the chunk IDs of the chunks to be deleted, and then execute the PURGE CHUNK statement. If you do not delete the merge-source chunks, you cannot execute the next adbmergechunk command.

Note that if processing of any other SQL statement or command does not reference the table subject to merge chunk processing, the merge-source chunks are deleted after the merge-target chunk is created regardless of the --purge-chunk option specification.

For details about considerations when specifying the --purge-chunk option, see Points to consider when specifying the --purge-chunk option of the adbmergechunk command in Merging chunks (to reduce the number of chunks) in the HADB Setup and Operation Guide.

-c {specification-of-merge-source-chunk-ID[,specification-of-merge-source-chunk-ID]...|ALL}

~<integer> ((1 to 9,223,372,036,854,775,807))

Specifies the chunk IDs of the merge-source chunks that are to be processed by merge chunk processing.

When ALL is specified, the command merges all chunks in the target table into a single new chunk. When merge-source chunk IDs are specified, the command merges only the chunks with the specified IDs into a new chunk.

Important

You cannot merge chunks that are in a different status (chunks in normal status and chunks in wait status).

When you specify merge-source chunk IDs, specify at least two chunk IDs. There are two methods that you can use to specify the merge-source chunk IDs, which can be specified at the same time as shown in the following figure.

Figure 33‒4: Specification example of merge-source chunk IDs in the -c option

[Figure]

  • Specifying individual chunk IDs (individual specification)

    If you specify the IDs of individual merge-source chunks, separate the chunk IDs with the comma (,).

    Important

    There must be no spaces before or after a comma (,).

  • Specifying a range of chunk IDs (range specification)

    If you specify a range of merge-source chunk IDs, use the format smallest-chunk-ID-in-the-range-largest-chunk-ID-in-the-range (connect the two chunk IDs with a hyphen (-)).

    Important

    There must be no spaces before or after the hyphen (-). The chunk ID specified to the right of the hyphen must be greater than the chunk ID specified to the left of the hyphen.

The following rules apply to specifying this information:

  • Do not specify both ALL and chunk IDs.

  • If the target table does not include a specified chunk ID, the command ignores that chunk ID and merges only those specified chunks whose IDs do exist in the target table.

  • You can specify maximum of 30,000 chunk IDs. The following explains how chunk IDs are counted:

    • For a range specification, all chunk IDs in the specified range are counted.

    • If any duplicate chunk IDs are specified, the duplicate chunk IDs are counted.

    Specification examples of merge-source chunk IDs and how to count them

    Example 1: -c 1,3,5: The command assumes that three chunk IDs are specified (1, 3, and 5).

    Example 2: -c 1,3,5-8,10: The command assumes that seven chunk IDs are specified (1, 3, 5, 6, 7, 8, and 10).

    Example 3: -c 1,3,5,5-8,10: The command assumes that eight chunk IDs are specified (1, 3, 5, 5, 6, 7, 8, and 10).

  • The maximum permitted length of the entire value specified in the -c option is 32 kilobytes. If the length would exceed 32 kilobytes, use range specifications or execute the adbmergechunk command more than once.

    [Figure]

  • For details about specifications that result in an error and specification examples, see (3) Errors that can be caused by the -c option.

The following explains how to determine the chunk IDs that exist in a table to be processed:

  • Searching system tables for STATUS_CHUNKS

    Search system tables for STATUS_CHUNKS, and check the chunk IDs. For details, see Checking the information about all chunks in a table based on a table name in Searching system tables in System Tables in the HADB Setup and Operation Guide.

  • Executing the adbdbstatus command

    Execute the following command to output the usage information for DB areas, tables, and indexes, and then check the chunk IDs (Chunk_ID) (the results are output in CSV format). For details about the items that are output as usage information for DB areas, tables, and indexes, see 13.7.2 List of items that are output as usage information for DB areas, tables, and indexes.

    adbdbstatus -d used -c table -n name-of-table-to-be-processed

    Specify name-of-table-to-be-processed in the format schema-name.table-identifier.

table-to-be-processed

Specifies the multi-chunk table that is to be processed by merge chunk processing.

The following rules apply to specifying this information:

  • Specify in the format schema-name.table-identifier.

    If the user owns this table, the schema name can be omitted. If another HADB user owns this table, schema name must be specified.

  • For details about the specification rules that apply when a schema name or table identifier includes any lowercase letter or backslash (\), see 1.4.3 Table name specification rules.

  • The user can specify only a table for which the user has the MERGE CHUNK privilege.

  • Tables other than multi-chunk tables cannot be specified.

  • A viewed table cannot be specified.

(3) Errors that can be caused by the -c option

The following are two possible causes of errors in the adbmergechunk command that can be caused by the -c option's specification:

In either case, correct the specification, and then re-execute the adbmergechunk command. For details about the -c option, see -c in (2) Explanation of options.

(a) When the specification format of the -c option is invalid

The table below lists the message IDs that are displayed when the specification format of the -c option is invalid and describes the possible errors. If any of these errors occurs, correct the error, and then re-execute the adbmergechunk command.

Table 33‒1: Message IDs that are displayed when the specification format of the -c option is invalid and possible errors

No.

Message ID that is displayed

Possible error

Example of invalid specification

Example of corrected specification

1

KFAA50225-E

The number of specified chunk IDs exceeds 30,000.

-c 1-30001

-c 1-30000

2

ALL and merge-source chunk IDs are both specified.

-c 1,3,ALL,10

  • -c ALL

  • -c 1,3,10

3

The same chunk ID is specified on both sides of a hyphen (-).

-c 3-3,7

-c 3-5,7

4

The value of the chunk ID on the right side of a hyphen (-) is less than the value of the chunk ID on the left side.

-c 10-3

-c 3-10

5

KFAA50296-E

Only one chunk ID is specified (including when only one chunk ID is specified and it is specified more than once).

  • -c 3

  • -c 3,3,3

-c 3,4

6

  • KFAA90002-E

  • KFAA96780-I

There is a space between a chunk ID and a comma.

-c 1,3,[Figure]10

-c 1,3,10

7

There is a space between a chunk ID and a hyphen (-).

-c 1,3[Figure]-[Figure]10

-c 1,3-10

8

KFAA90003-E

The length of the specified value exceeds 32 kilobytes.

[Figure]

-c 1-xxxxx

Change from individual specification to range specification (use a hyphen (-), not a comma (,))

Legend:

Δ: Space

(b) When an invalid chunk ID is specified in the -c option

The table below lists the message IDs that are displayed when an invalid chunk ID is specified in the -c option and describes the possible errors. If any of these errors occurs, correct the error, and then re-execute the adbmergechunk command.

Table 33‒2: Message IDs that are displayed when an invalid chunk ID is specified in the -c option and possible errors

No.

Message ID that is displayed

Possible error

Example of invalid specification

Example of corrected specification and corrective action to take

1

KFAA50294-E

A chunk ID that does not exist in the target table is specified (a chunk ID that is outside the range from minimum chunk ID to maximum chunk ID).

Only chunk IDs 3 and 6 exist in the target table:
  • -c 2-6

  • -c 6,7

  • -c 2-7

Only chunk IDs 3 and 6 exist in the target table:
  • -c 3,6

  • -c 3-6

Search the target table for its chunk IDs and specify chunk IDs that exist in the table.

2

KFAA50296-E

There is only one merge-source chunk because a chunk ID that does not exist in the target table is specified.

Only chunk IDs 3 and 6 exist in the target table:
  • -c 3-5

  • -c 4,5

Only chunk IDs 3 and 6 exist in the target table:
  • -c 3,6

  • -c 3-6

Search the target table for its chunk IDs and correct the specification so that multiple merge-source chunks are specified.

3

KFAA50299-E

Among the merge-source chunks there are chunks in normal status intermixed with chunks in wait status.

Chunks with IDs 1 and 2 are in normal status, and chunks with IDs 3 and 4 are in wait status:
  • -c 1,3

  • -c 1-3

Chunks with IDs 1 and 2 are in normal status, and chunks with IDs 3 and 4 are in wait status:
  • -c 1,2

  • -c 3-4

Correct the specification so that the merge-source chunks include only chunks in normal status or only chunks in wait status.

4

Among the merge-source chunks there are archived chunks intermixed with chunks that are not archived.

Chunks with IDs 1 and 2 are archived, and chunks with IDs 3 and 4 are not archived:
  • -c 1,3

  • -c 1-3

Chunks with IDs 1 and 2 are archived, and chunks with IDs 3 and 4 are not archived:
  • -c 1,2

  • -c 3-4

Correct the specification so that the merge-source chunks include only archived chunks or only chunks that are not archived.

Note:

For details about how to search for the chunk IDs in the table to be processed, see -c in(2) Explanation of options.