Import and export of DB2 tables

Source: Internet
Author: User
Tags db2 db2 connect db2 connect to

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.