HiRDB Dataextractor Version 8 Description, User's Guide and Operator's Guide

[Contents][Index][Back][Next]

3.3 Importing data

Data import by HiRDB Dataextractor involves receiving data from a source system and then setting that data into a HiRDB database on the target system.

The explanation in this section is for data extraction from a HiRDB database and data import into a HiRDB database.

Organization of this section
(1) Specifying the data storage method
(2) Specifying the data import method
(3) Converting the data types
(4) Converting character codes
(5) Creating an output file
(6) Notes on data import

(1) Specifying the data storage method

There are two ways to store data in a HiRDB table:

(a) Storing data by table

This method uses the HiRDB table as the unit of storage. HiRDB Dataextractor assumes this method when the -j option is omitted from the xtrep command. If the target HiRDB table is row-partitioned, you should store data by RDAREA instead of by table in order to reduce the time required to perform data storage because HiRDB Dataextractor can store data in multiple RDAREAs at the same time.

(b) Storing data by RDAREA

This method uses the RDAREA as the unit of storage into a HiRDB table. HiRDB Dataextractor assumes this method when the -j option is specified in the xtrep command. If the target HiRDB table is row-partitioned, you can save processing time by using this method because you can start an instance of HiRDB Dataextractor for each RDAREA in order to execute multiple storage processes in parallel.

HiRDB Dataextractor supports data storage by RDAREA for the following type of row-partitioning:

Figure 3-10 provides an overview of storage by RDAREAs, and Table 3-12 shows the handling of data storage by RDAREA.

Figure 3-10 Overview of data storage by RDAREA

[Figure]

Table 3-12 Handling of data storage by RDAREA

Row partitioning method HiRDB's pdload processing Handling during extraction Handling during storage
Key range partitioning Checks that the input data is within the specified RDAREA storage range before actually storing the data. If the data extends outside the storage range and an error data file is specified (-q option in xtrep command), outputs the corresponding row data to the error data file. Specifies extraction conditions and extracts the data that satisfies the storage conditions for the specified RDAREA. In the case of a row-partitioned table in the server, you must use HiRDB's database reorganization utility to create a non-partitioning key index after data storage; see Note below.
You can use the error data file as an input file to pdload. If data that extends outside the storage range is output to the error data file, check the data and use pdload to store it in the table, if necessary.

Note

(2) Specifying the data import method

HiRDB Dataextractor uses HiRDB's database load utility (pdload) to import data. You can specify the following import methods using the options of the xtrep command:

(3) Converting the data types

If the data type of a table column on the source system does not match the data type on the target system, HiRDB Dataextractor converts it to the data type for HiRDB columns, if possible. For the convertible data types, see 3.1.3 Converting the data type of extracted data or 3.1.2 Adding columns to extracted data.

(4) Converting character codes

When there is a data linkage between ORACLE and HiRDB systems or between HiRDB systems, character codes can be converted as specified in the environment variable in order to import data. For details about the character codes sets that can be converted, see 3.1.4 Converting the character codes of extracted data. For details about how to use this function, see 4.2.3 Additional data extraction and import functions or 5.1.3 Additional data extraction and import functions.

(5) Creating an output file

The xtrep command lets you output extracted data to a file before starting up pdload. This file is called an output file. The output file is in the binary format. For details about the binary format, see Table 4-16.

To output data to an output file, specify the -o or -O option according to the output file processing method to be used after data is stored in a table. There are two ways of processing the output file:

If extracted columns include a BLOB column, HiRDB Dataextractor creates LOB input files as well as the output file. A LOB input file is created for each LOB data item. You can use the -b option to specify a directory for storing the LOB input files. The -o or -O option determines the LOB input file processing method after import processing. To store BLOB-column data in the same output file as for non-BLOB data without creating a LOB input file, specify the XTLOBKIND environment variable.

If an output file or LOB input file to be created already exists, the -y option determines whether or not to overwrite the existing file. When the -y option is specified, HiRDB Dataextractor deletes the existing file and then outputs data to a new file. When the -y option is omitted, HiRDB Dataextractor outputs a message and terminates the processing.

The output file and LOB input files are created on the host at the following HiRDB server on the target system:

(6) Notes on data import