DB2 data export command

Source: Internet
Author: User
1. Using db2move to export all data db2move is an integrated data migration tool that supports export, import, and load operations. In fact, the three methods of db2move are implemented by simply using the db2export, db2import, and db2load commands. This section only describes its export

1. Using db2move to export all data db2move is an integrated data migration tool that supports export, import, and load operations. In fact, the three methods of db2move are implemented by simply using the db2 export, db2 import, and db2 load commands. This section only describes its export

1. Use db2move to export all data

Db2move is an integrated data migration tool that supports export, import, and load operations. In fact, the three methods of db2move are implemented by simply using the db2 export, db2 import, and db2 load commands.

This section only describes its export function. import and load will be described later. The format of the data file exported using db2move is IXF.

Create and enter the data storage directory:
$ Mkdir/home/backup/mydata
$ Cd/home/backup/mydata

Export all data in the specified database:
$ Db2move testdb export-u db2inst1-p thepasswd

Note:
1. This will extract all the data in testdb to the current directory (/home/backup/mydata. The content of each table is stored in one. in the ixf file, each. each ixf file corresponds to one. msg file ,. the msg file describes the information when exporting data from the table. There are also two files. db2move. lst is used to record the one-to-one correspondence between the. ixf file and the. msg file and the table. EXPORT. out records the screen output when exporting data.

2. Export the table structure. The command line is as follows:

Db2look-d dbname-e-a-x-I username-w passWord-o ddlfile. SQL

3. Export table data

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

Example: export to "data/DBMEMUSE_WATCHER.ixf" of ixf messages "data/DBMEMUSE_WATCHER.txt" SELECT * FROM DBMEMUSE_WATCHER;

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.