Hitachi

Hitachi Advanced Database Command Reference


17.3.4 Background importing CSV-format table data compressed in GZIP format

In this example, table data is imported under the following conditions:

[Figure]

This example uses the following procedure to execute the adbimport command.

Procedure
  1. Create an input data path file.

  2. Create an import option file.

  3. Execute the adbimport command.

Using examples, the following subsections explain each of these steps.

Organization of this subsection

(1) Creating an input data path file

In this example, an input data path file is created, and paths are specified for all the input data files.

Example specification of an input data path file
/mnt/diska/wwwww/imp1.csv.gz
/mnt/diskb/xxxxx/imp2.csv.gz

(2) Creating an import option file

In this example, an import option file is created, and import options are specified.

Example specification of an import option file
set adb_import_errdata_file_name = "/home/adbmanager/imp_file/errdata.csv"   ...1
set adb_import_errdata_num = 500                                             ...2
set adb_import_read_size = 1024                                              ...3
set adb_import_decompress_buff_size = 1024
           :
Explanation:
  1. The logical error data file that outputs the logical error data is specified.

  2. The maximum number of output items of logical error data is specified.

  3. Other import options relating to performance are specified.

(3) Executing the adbimport command

adbimport -u ADBUSER01                             ...1
          -p '#HelloHADB_01'                       ...2
          -k "'"                                   ...3
          -s ,                                     ...4
          -g 10                                    ...5
          -w /home/adbmanager/tmp                  ...6
          -z /home/adbmanager/imp_file/env01.txt   ...7
          -b                                       ...8
          TABLE01                                  ...9
          /home/adbmanager/imp_file/inf01.txt      ...10
Explanation:
  1. Specifies the authorization identifier of the HADB user who executes the adbimport command.

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

  3. Specifies the enclosing characters (single quotation marks) to be used within input data files. If you specify single quotation marks as the enclosing characters, note that single quotation marks must be enclosed in double quotation marks (").

  4. Specifies the delimiters (commas) to be used within input data files.

  5. Specifies to output progress messages (KFAA80205-I) for every 10,000 rows of data import processing.

  6. Specifies the directory that stores temporary work files created during data import processing.

  7. Specifies the absolute path name of the import option file created in (2) Creating an import option file.

  8. Specifies to background import table data.

  9. Specifies the target table to be imported (TABLE01).

  10. Specifies the absolute path name of the input data path file created in (1) Creating an input data path file.