Hitachi

Hitachi Advanced Database Command Reference


17.3.3 Importing table data in fixed-length format

This example imports table data 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. Create a column structure information file.

  4. Execute the adbimport command.

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

Organization of this subsection

(1) Creating the input data path file

This example creates an input data path file and specifies in it the paths of the two input data files.

Example of an input data path file
/mnt/diska/wwwww/imp1
/mnt/diskb/xxxxx/imp2

(2) Creating an import option file

This example creates an import option file that specifies import options.

Example of an import option file
set adb_import_errdata_file_name = "/home/adbmanager/imp_file/errdata"   ...1
set adb_import_errdata_num = 500                                         ...2
set adb_import_rthd_num = 2                                              ...3
set adb_import_sort_buff_size = 2
           :
Explanation:
  1. Specifies a logical error data file to which logical error data is to be output.

  2. Specifies the maximum number of logical error data items that can be output.

  3. Specifies other performance-related import options.

(3) Creating a column structure information file

This example creates a column structure information file that specifies column structure information options.

Example of column structure information file
set adb_import_input_record_size = 38   ...1
 
adbcolumninfo -n C1  -p 1,10            ...2
adbcolumninfo -n C2  -p 11,8
adbcolumninfo -n C3  -p 19,20
Explanation:
  1. Specifies the record length in the input data files.

  2. Specifies how to handle input data for each column (C1, C2, and C3) defined for the table to be processed.

    This example assumes that columns C1 (CHAR(10)), C2 (INT), and C3 (CHAR(20)) are defined for TABLE01.

For details about the specification patterns for column structure information options for each combination of contents of input data files and the column definition for the table to be processed, see (2) When the file format of the input data files is fixed-length in 17.2.5 Specification patterns for the column structure information options.

(4) Executing the adbimport command

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

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

  3. Specifies that a data import progress message (KFAA80205-I) is to be output after every 10,000 rows.

  4. Specifies a directory for storing temporary work files that will be created during data import processing.

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

  6. Specifies the fixed-length format for the input data files.

  7. Specifies the absolute path name of the column structure information file created in (3) Creating a column structure information file.

  8. Specifies the table that is to be the target of import processing (TABLE01).

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