IBM DB2 Computer Accessories User Manual


 
236 DB2 Deployment Guide
For a detailed description of the export utility, refer to the DB2 Infocenter:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.d
b2.luw.admin.dm.doc/doc/c0004587.html
Importing data
You can use either the import utility or the load utility to move the exported data
into the target database. The import utility is based upon the SQL statements
and all the integrities and constraints are obtained during import. In general, the
import utility is used if the amount of data is not to big. For large amount of data,
the load utility is much faster. However, the load utility does not set referential
integrity, which mean that foreign key relations are not checked. After the load
utility has completed, some tables might be in integrity pending state and are not
accessible. You can use the set integrity command to validate dependencies
and bring tables back into accessible mode.
Another difference between import and load is that the import utility cannot
override the columns defined as generated always. The load utility is required if
there are such columns in the tables.
Assuming that there are no special requirements or data restrictions that force us
to choose one over the other, the choice can usually be based on the amount of
data and the performance requirements. If the data volume is large and the
performance is a concern, the load utility is preferable.
For a thorough comparison of these two methods, refer to the DB2 Infocenter:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.admi
n.dm.doc/doc/r0004639.html
Import utility
The import utility populates a table with data by using the SQL INSERT
statement. There are several options on how to control the behavior of the utility.
The most important option is the import mode. This mode controls what to do
with existing data in the tables. Table 5-2 lists the different modes.
Table 5-2 The different import modes
Mode Description
INSERT Insert the data into the target table without changing existing data.
INSER_UPDATE Update rows with matching primary key values with values of the
input rows. If there is no matching row, insert the data row into the
table.
REPLACE Delete all the existing data and insert the input data. The table and
index definitions are kept.