4. Export and Import database data using the Db2move command Export the initialization data from another database, first enter the exported directory, first Db2cmd, then enter the command: Db2move dbname export–u username–p password. Note: dbname is the original database name and username is the username password password.
The Restore command is: db2move dbname import-u username-p Password
5. Other:.
Export to a file for SQL statements
db2look-d cqyancao-e-o db.sql-i db2user-w PSW
Database name to go out filename user name password
Example: db2look-d department-u walid-e-o db2look.sql
--This will generate DDL statements for all tables and federated objects created by user WALID
--Db2look output is sent to a file named Db2look.sql
Example: db2look-d department-z myscm1-e-o db2look.sql
--This will generate DDL statements for all tables with a schema name of MYSCM1
--also generates the DDL for all federated objects created $USER.
--Db2look output is sent to a file named Db2look.sql
Example: db2look-d department-u walid-m-o db2look.sql
--This generates an UPDATE statement to capture statistics about the tables/aliases created by the user WALID
--Db2look output is sent to a file named Db2look.sql
Example: db2look-d department-u walid-e-wrapper w1-o db2look.sql
--This will generate DDL statements for all tables created by user WALID
--also generates DDL for all federated objects created by user WALID for wrapper W1
--Db2look output is sent to a file named Db2look.sql
Example: db2look-d department-u walid-e-server s1-o db2look.sql
--This will generate DDL statements for all tables created by user WALID
--also generates DDL for all federated objects created by user WALID for server S1
--Db2look output is sent to a file named Db2look.sql
DB2 backup and import a single table operation DB2 Connect to database name user login using login password
>DB2 Export to T1.ixf of the IXF select * FROM table name
>DB2 Import from T1.IXF to IXF insert into destination table name or new table name
The data format of the exported library also has two kinds of del (file format) and WSF, but IXF format information is the most complete,
Contains table structure information to recover a deleted table.
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.