Import steps for migrating DB2 databases in Linux (1)

Source: Internet
Author: User

Today we are going to discuss with you the actual operation steps for correctly importing the DB2 database under the Linux operating platform. If you want to import the DB2 database, if you are curious, the following articles will unveil its mysteries.

(1) Extract

Main commands:

 
 
  1. tar zxfv oatest0303.tar.gz  
  2. [db2inst1@devsvr2 db2inst1]$ tar zxfv oatest0303.tar.gz  
  3. oatest0303/  
  4. oatest0303/oatest.sql  
  5. oatest0303/EXPORT.out  
  6. oatest0303/db2move.lst  
  7. …… 

(2) create a new database db2 create db sample

Main commands:

 
 
  1. db2 create db sample  
  2. [db2inst1@devsvr2 db2inst1]$ db2 create db sample 

The DB20000I create database Command is successfully completed.

(3) execute the oatest. SQL script to create a database

Main commands:

 
 
  1. db2 -tvf oatest.sql  
  2. [db2inst1@devsvr2 db2inst1]$ cd oatest0303  
  3. [db2inst1@devsvr2 oatest0303]$ db2 -tvf oatest.sql  
  4. …… 

(4) import data by performing the db2move migration to migrate the DB2 database on the Linux platform

Main commands:

 
 
  1. db2move sample load  
  2. [db2inst1@devsvr2 oatest0303]$ db2move sample load  
  3. ……  
  4. * LOAD: table "OATEST "."UM_USER"  
  5. -Rows read: 1529  
  6. -Loaded: 1529  
  7. -Rejected: 0  
  8. -Deleted: 0  
  9. -Committed: 1529  
  10. Disconnecting from database ... successful!  
  11. End time: Sun Mar 5 10:24:22 2006  

(5) check consistency

Main commands:

 
 
  1. db2 set integrity for oatest.UM_USER immediate checked  
  2. [db2inst1@devsvr2 oatest0303]$ db2 connect to sample 

Database connection information

Database Server = DB2/LINUX 8.2.0

SQL authorization id = DB2INST1

Local Database alias = SAMPLE

 
 
  1. [db2inst1@devsvr2 oatest0303]$ db2 "select count(*) from  
  2. oatest.um_user"  
  3. 1  

SQL0668N the operation is not allowed due to the cause code "1" on the table "OATEST. UM_USER.

 
 
  1. SQLSTATE=57016 
  2. [db2inst1@devsvr2 oatest0303]$ db2 set integrity for oatest.UM_USER  
  3. immediate checked  

The DB20000I SQL command is successfully completed.

 
 
  1. [db2inst1@devsvr2 oatest0303]$ db2 "select count(*) from  
  2. oatest.um_user"  
  3. 1  
  4. 1529 

1 record selected.

Use SQL statements to obtain the execution statement of the table to be checked


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.