DB2 Online Export Method

Source: Internet
Author: User

The DB2 Online Export method may not be known to everyone. The following describes the detailed steps for online DB2 export. If you are interested in online DB2 export, take a look.

DB2 Online Export

1. Export table structures, views, stored procedures, triggers, functions, sequences, etc., excluding binary objects such as blob to the specified file

Run the following command on the DB2 console:

Db2look-d tb33-e-a-x-I tb33-w tb33-o TB33. SQL

Parameter description:

-D: Specifies the database name.

-E: extract the DDL files required for database replication.

-A: generate statistics for all created programs

-X: generate the "Authorization" Statement DDL for the original definition program of the exclusion object

-I: the user ID used to log on to the server where the database resides.

-W: The password used to log on to the server where the database resides.

-O: redirects the output to the specified file name.

2. Export table data

Export table data is executed in two steps: generate the Export command script file and execute the Export command script file.

1. Generate the Export command script file:

Run the following statement using the DB2Manager tool to generate the export table data command. type = 'T' indicates that only table data is exported;

-- Export table data statement
Select 'export to H: \ db2 \ TB33 \ '| rtrim (tabname) | '. ixf of ixf select * from '| rtrim (tabname) |'; 'from syscat. tables where tabschema = 'tb33' and type = 'T'

Command Execution instructions:

Export command for generating all table data in database TB33; this export command specifies to save the table data of each table as the table name. the ixf file is saved in the directory H: \ db2 \ TB33 \. The generated command is saved as an export.txt file.

2. Execute the Export command script file:

Run the following command on the DB2 console:

Db2-tvf export.txt.

Parameter description:

-T: Specifies the statement termination character.

-V: display the execution content on the console

-F: Read the input file.

After the script is successfully executed, the table name. ixf table data is generated in the directory H: \ db2 \ TB33.

Common db2 stored procedure statements

Usage of DB2 Merge statements

Overview of DB2 Flow Control clauses

In-depth discussion of DB2 table connection principles

Common DB2 cycle usage

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.