Import and export of DB2 tables I know the following two ways:
1)
Db2move dbname Export-tn tabname1
This export can select a schema, or select multiple tables, if you need to export more than one table, you can separate the table with commas, as follows:
Db2move dbname Export-tn Tabname1,tabname2,tabname3
The file will have a. ixf file and a. msg file
. ixf files are text-formatted files
Import Method:
Db2move dbname Import
Db2move dbname Load
To do a test, it is obvious that Db2move dbname load is more efficient than import. Privately feel that Db2move load is a bit like the Sqlloader command in Oracle
Similarly, import a text-formatted file into the table.
The following is a result of DB2 load:
$
$ db2move Lis Load
Db2move * * * *
Action:load
Start TIME:SAT Mar 1 20:58:00 2014
Connecting to database LIS ... successful! SERVER:DB2 Common Server V9.7.3
* load:table "Db2inst1". " Lcinsureacctrace "
-rows read:981055
-loaded:981055
-rejected:0
-deleted:0
-committed:981055
Disconnecting from Database ... successful!
End TIME:SAT Mar 1 20:59:34 2014
$
2)
DB2 Connect to sample
DB2 "Export TO/DIR1/XXX_FILE_NAME.IXF of IXF select * from Table_name1"
DB2 "Import from T1.IXF of IXF inserts into New_tablename2"
Compared to the above method of import and export, the second method can choose to export some data in a table, you can add conditional items, such as:
DB2 "Export TO/DIR1/XXX_FILE_NAME.IXF of IXF select * from table_name1 where col1=xx"
Import and export of DB2 tables