Hitachi

Hitachi Advanced Database Setup and Operation Guide


11.4.5 Exporting data in units of chunks

You can output data from a multi-chunk table to a file in units of chunks by using either of the following two methods. Both methods require you to specify the chunk ID of each chunk to be output.

Note

We recommend that, of the two preceding methods, you use the method that uses the adbexport command. The adbexport command can output data in a shorter time than the adbsql command. Use the adbsql command only when an HADB client (Linux version) needs to output data from a multi-chunk table to a file.

The following shows the types of chunks from which you can output data by using the preceding two methods.

Types of chunk data that can be output
  • Chunk in normal status

  • Chunk in wait status

With the preceding two methods, you can output data from not only chunks in normal status, but also chunks in wait status. Note that you cannot output data from chunks in wait status in the case shown in 11.1.8 Outputting data from a base table to a file (data export).

The following describes the procedures for outputting data in units of chunks by using the adbexport command and by using the adbsql command.

Important

If a chunk is being merged with other chunks by using the adbmergechunk command, we recommend that you do not output data from that chunk. Output data from the chunk to a file after the adbmergechunk command has completed the chunk merge processing. If you output data from a chunk that is being merged with other chunks by using the adbmergechunk command, the data to be output to the file differs depending on the timing. For details, see (4) Chunks that are retrieved during execution of the adbmergechunk command in 11.4.9 Merging chunks (to reduce the number of chunks).

■ Procedure for outputting data by executing the adbexport command with the -c option

  1. Determine the chunk ID of the chunk to be output.

    Check the ID of the chunk you intend to specify in the -c option of the adbexport command. The chunk ID information is stored in the STATUS_CHUNKS system table.

    For details about how to determine the chunk ID, see C.9 Searching system tables.

  2. Execute the adbexport command.

    Based on the determined chunk ID, execute the adbexport command with the -c option specified to output the data that is stored in the chunk you want to output.

    To output data to a CSV file compressed in GZIP format, also specify the --compress GZIP option.

    For details about the adbexport command, see adbexport (Export Data) in the manual HADB Command Reference.

■ Procedure for outputting data by executing the #GETDATA subcommand of the adbsql command

  1. Determine the chunk ID of the chunk to be output.

    Check the chunk ID to be specified for CHUNKID in the #GETDATA subcommand of the adbsql command. The chunk ID information is stored in the STATUS_CHUNKS system table.

    For details about how to determine the chunk ID, see C.9 Searching system tables.

  2. Executing the adbsql command

    Based on the determined chunk ID, execute the #GETDATA subcommand of the adbsql command to output the data that is stored in the chunk you want to output.

    For details about the #GETDATA subcommand of the adbsql command, see adbsql subcommands in adbsql (Execute SQL Statements) in the manual HADB Command Reference.