DB2 Import and Export commands

Source: Internet
Author: User

Export table data

Export to [path (example: D: \ TABLE1.ixf)] of ixf select [field (example: * or col1, col2, col3)] from TABLE1;

Export to [path (example: D: \ TABLE1.del)] of del select [field (example: * or col1, col2, col3)] from TABLE1;

Import table data

Import from [path (for example: D: \ TABLE1.ixf)] of ixf insert into TABLE1;

Load from [path (for example: D: \ TABLE1.ixf)] of ixf insert into TABLE1;

Load from [path (for example: D: \ TABLE1.ixf)] of ixf replace into TABLE1; // delete an existing record before loading data.

Load from [path (for example: D: \ TABLE1.ixf)] of ixf restart into TABLE1; // re-execute when loading fails.

Record export results and error messages

Import from [path (example: D: \ TABLE1.ixf)] of ixf savecount 1000 messages [path (example: D: \ msg.txt)] insert into TABLE1; // where, savecount indicates that every 1000 operations are completed and recorded once.

Import data with auto-increment fields:

Load from [path (for example: D: \ TABLE1.ixf)] of ixf modified by identityignore insert into TABLE1; // Add modified by identityignore.

Check suspension occurs when data is loaded.

Set integrity for Table1 check immediate unchecked;

The command is only valid for the tables whose data passes the constraints check. If the execution cannot be lifted, it is necessary to check the data integrity, whether it does not meet the constraints, and try to refresh the data, and then perform the load operation.

In addition, for load and import, the literal difference is: load and import, but still do not understand the difference between the two.

But load is obviously better than import in terms of performance.

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.