Db2 command to export the imported table structure and data

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

1. Open the cmd command window, enter d: db2 under the db2 installation directory, and run the command: DB2CMD to enter the db2 CLP window. Www.2cto.com 2. create a data folder command: mkdir data description: export the SQL statement of the full table structure of the database to the data directory 3. enter the data directory command: CD data4 export database table structure: db2look-d wides1-u db2admin-t sys_account_tb-e-o account. SQL Description: generate an account. SQL is sent to d: db2 \ data 5. export the data of a single database table: D: \ db2 \ data> db2 connect to wides1 database connection information database server = DB2/NT 9.5.0 SQL authorization id = SYY local database alias = WIDES1 www.2cto.com D: \ db2 \ data> db2 export to d: \ db2 \ data \ sys_account_tb.ixf of ixf messages msgselect * from sys. number of lines exported by sys_account_tb: 3792 D: \ db2 \ data> 6. import table data: D: \ db2 \ data> db2 import from d: \ db2 \ data \ sys_account_tb.ixf of ixf messages msg insert into sys. sys_account_tb read rows = 3792 skip rows = 0 inserted rows = 0 updated rows = 0 rejected rows = 3792 implemented rows = 3792

Related Article

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.