DB2數據庫遷移
DB2數據庫遷移
環境介紹:
原數據庫:Windows Server 2008 R2 64bit下的DB2 V10.5.3數據庫
目標標數據庫:RHEL 7.0 64bit下的DB2 V10.5.3數據庫
遷移方法:使用db2move和db2look工具
首先從Windows下導出表結構和表數據:
a.準備目錄D:\yjmhbak,用於存放導出來的數據文件;
b.使用有數據庫權限的賬戶進行數據庫連接、導出等操作。如需將賬戶加入DB2ADMNS組中。
導出數據:
D:\yjmhbak>db2stop force
2017-11-15 14:39:06 0 0 SQL1064N DB2STOP 處理成功。
SQL1064N DB2STOP 處理成功。
D:\yjmhbak>db2start
2017-11-15 14:39:24 0 0 SQL1063N DB2START 處理成功。
SQL1063N DB2START 處理成功。
D:\yjmhbak>db2move YJMH export -aw
***** DB2MOVE *****
Action: EXPORT
Start time: Wed Nov 15 14:39:58 2017
Connecting to database YJMH ... successful! Server : DB2 Common Server V10.5.3
EXPORT: 108 rows from table "SYSTOOLS"."ALTOBJ_INFO"
EXPORT: 0 rows from table "SYSTOOLS"."FED_CACHE_MQTS"
EXPORT: 0 rows from table "SYSTOOLS"."FED_CACHE_OPTIONS"
EXPORT: 191 rows from table "SYSTOOLS"."HMON_ATM_INFO"
EXPORT: 0 rows from table "SYSTOOLS"."HMON_COLLECTION"
EXPORT: 5 rows from table "SYSTOOLS"."POLICY"
EXPORT: 1 rows from table "SYSTOOLS"."STMG_DBSIZE_INFO"
EXPORT: 15085 rows from table "FUTURECLOUD"."T_ACCOUNT"
EXPORT: 325 rows from table "FUTURECLOUD"."T_ACCOUNT_BK"
EXPORT: 3202311 rows from table "FUTURECLOUD"."T_ACCOUNT_FUNCTION"
EXPORT: 1816 rows from table "FUTURECLOUD"."T_ACCOUNT_MESSAGEADDRESSLIST"
EXPORT: 476 rows from table "FUTURECLOUD"."T_ACCOUNT_MESSAGEGROUP"
EXPORT: 30265 rows from table "FUTURECLOUD"."T_ACCOUNT_MESSAGESEARCH"
EXPORT: 1371358 rows from table "FUTURECLOUD"."T_ACCOUNT_MODULE"
EXPORT: 17007 rows from table "FUTURECLOUD"."T_ACCOUNT_QUESTION"
EXPORT: 49830 rows from table "FUTURECLOUD"."T_ACCOUNT_ROLE"
EXPORT: 20028 rows from table "FUTURECLOUD"."T_ADDRESSLIST"
EXPORT: 2821 rows from table "FUTURECLOUD"."T_ADDRESSLIST_0214"
EXPORT: 2367 rows from table "FUTURECLOUD"."T_ADDRESSLIST_021416"
EXPORT: 0 rows from table "FUTURECLOUD"."T_ADDRESSLIST_BK"
EXPORT: 0 rows from table "FUTURECLOUD"."T_ADDRESSLIST_TEMP"
EXPORT: 13 rows from table "FUTURECLOUD"."T_ADMINAUTHORITY"
EXPORT: 11 rows from table "FUTURECLOUD"."T_APPLICATION"
EXPORT: 14 rows from table "FUTURECLOUD"."T_APPLICATION_AREAINFO"
EXPORT: 1966 rows from table "FUTURECLOUD"."T_AREAGROUP"
EXPORT: 4612 rows from table "FUTURECLOUD"."T_AREAINFO"
EXPORT: 14947 rows from table "FUTURECLOUD"."T_DEPARTMENT"
EXPORT: 8640 rows from table "FUTURECLOUD"."T_DEPARTMENT_0311"
EXPORT: 61 rows from table "FUTURECLOUD"."T_DICTIONARY"
EXPORT: 64 rows from table "FUTURECLOUD"."T_DUTY"
EXPORT: 703 rows from table "FUTURECLOUD"."T_FUNCTION"
EXPORT: 1413501 rows from table "FUTURECLOUD"."T_LOG"
EXPORT: 93647 rows from table "FUTURECLOUD"."T_LOGINRECORD"
EXPORT: 72 rows from table "FUTURECLOUD"."T_LOG_DIRECTORY"
EXPORT: 1599 rows from table "FUTURECLOUD"."T_MAC_AREACODE"
EXPORT: 23 rows from table "FUTURECLOUD"."T_MESSAGESEARCH"
EXPORT: 205 rows from table "FUTURECLOUD"."T_MODULE"
EXPORT: 10700 rows from table "FUTURECLOUD"."T_NEWS"
EXPORT: 82000 rows from table "FUTURECLOUD"."T_NUMBERSEARCH"
EXPORT: 2050 rows from table "FUTURECLOUD"."T_RECEIVEMESSAGE"
EXPORT: 7992 rows from table "FUTURECLOUD"."T_ROLE"
EXPORT: 9216 rows from table "FUTURECLOUD"."T_ROLE_FUNCTION"
EXPORT: 7400 rows from table "FUTURECLOUD"."T_SECURITYCODE"
EXPORT: 51823 rows from table "FUTURECLOUD"."T_SENDMESSAGE"
EXPORT: 570 rows from table "FUTURECLOUD"."T_SMS_NUMBER"
EXPORT: 285 rows from table "FUTURECLOUD"."T_TIMERMESSAGE"
EXPORT: 1750985 rows from table "FUTURECLOUD"."T_WEBSERVICELOG"
Disconnecting from database ... successful!
End time: Wed Nov 15 14:57:21 2017
D:\yjmhbak>
導出完成!
本文出自 “花之旭's Blog” 博客,謝絕轉載!
DB2數據庫遷移