DB2数据库迁移

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DB2数据库迁移相关的知识,希望对你有一定的参考价值。

DB2数据库迁移

环境介绍:

原数据库:Windows Server 2008 R2 64bit下的DB2 V10.5.3数据库

目标标数据库:RHEL 7.0 64bit下的DB2 V10.5.3数据库

迁移方法:使用db2move和db2look工具


  1. 首先从Windows下导出表结构和表数据:

    a.准备目录D:\yjmhbak,用于存放导出来的数据文件;

    b.使用有数据库权限的账户进行数据库连接、导出等操作。如需将账户加入DB2ADMNS组中。

  2. 导出数据:


  3. D:\yjmhbak>db2stop force

  4. 2017-11-15 14:39:06     0   0   SQL1064N  DB2STOP 处理成功。

  5. SQL1064N  DB2STOP 处理成功。


  6. D:\yjmhbak>db2start

  7. 2017-11-15 14:39:24     0   0   SQL1063N  DB2START 处理成功。

  8. SQL1063N  DB2START 处理成功。


  9. D:\yjmhbak>db2move YJMH export -aw


  10. *****  DB2MOVE  *****


  11. Action:  EXPORT


  12. Start time:  Wed Nov 15 14:39:58 2017



  13. Connecting to database YJMH ... successful!  Server : DB2 Common Server V10.5.3


  14. EXPORT:    108 rows from table "SYSTOOLS"."ALTOBJ_INFO"

  15. EXPORT:      0 rows from table "SYSTOOLS"."FED_CACHE_MQTS"

  16. EXPORT:      0 rows from table "SYSTOOLS"."FED_CACHE_OPTIONS"

  17. EXPORT:    191 rows from table "SYSTOOLS"."HMON_ATM_INFO"

  18. EXPORT:      0 rows from table "SYSTOOLS"."HMON_COLLECTION"

  19. EXPORT:      5 rows from table "SYSTOOLS"."POLICY"

  20. EXPORT:      1 rows from table "SYSTOOLS"."STMG_DBSIZE_INFO"

  21. EXPORT:  15085 rows from table "FUTURECLOUD"."T_ACCOUNT"

  22. EXPORT:    325 rows from table "FUTURECLOUD"."T_ACCOUNT_BK"

  23. EXPORT: 3202311 rows from table "FUTURECLOUD"."T_ACCOUNT_FUNCTION"

  24. EXPORT:   1816 rows from table "FUTURECLOUD"."T_ACCOUNT_MESSAGEADDRESSLIST"

  25. EXPORT:    476 rows from table "FUTURECLOUD"."T_ACCOUNT_MESSAGEGROUP"

  26. EXPORT:  30265 rows from table "FUTURECLOUD"."T_ACCOUNT_MESSAGESEARCH"

  27. EXPORT: 1371358 rows from table "FUTURECLOUD"."T_ACCOUNT_MODULE"

  28. EXPORT:  17007 rows from table "FUTURECLOUD"."T_ACCOUNT_QUESTION"

  29. EXPORT:  49830 rows from table "FUTURECLOUD"."T_ACCOUNT_ROLE"

  30. EXPORT:  20028 rows from table "FUTURECLOUD"."T_ADDRESSLIST"

  31. EXPORT:   2821 rows from table "FUTURECLOUD"."T_ADDRESSLIST_0214"

  32. EXPORT:   2367 rows from table "FUTURECLOUD"."T_ADDRESSLIST_021416"

  33. EXPORT:      0 rows from table "FUTURECLOUD"."T_ADDRESSLIST_BK"

  34. EXPORT:      0 rows from table "FUTURECLOUD"."T_ADDRESSLIST_TEMP"

  35. EXPORT:     13 rows from table "FUTURECLOUD"."T_ADMINAUTHORITY"

  36. EXPORT:     11 rows from table "FUTURECLOUD"."T_APPLICATION"

  37. EXPORT:     14 rows from table "FUTURECLOUD"."T_APPLICATION_AREAINFO"

  38. EXPORT:   1966 rows from table "FUTURECLOUD"."T_AREAGROUP"

  39. EXPORT:   4612 rows from table "FUTURECLOUD"."T_AREAINFO"

  40. EXPORT:  14947 rows from table "FUTURECLOUD"."T_DEPARTMENT"

  41. EXPORT:   8640 rows from table "FUTURECLOUD"."T_DEPARTMENT_0311"

  42. EXPORT:     61 rows from table "FUTURECLOUD"."T_DICTIONARY"

  43. EXPORT:     64 rows from table "FUTURECLOUD"."T_DUTY"

  44. EXPORT:    703 rows from table "FUTURECLOUD"."T_FUNCTION"

  45. EXPORT: 1413501 rows from table "FUTURECLOUD"."T_LOG"

  46. EXPORT:  93647 rows from table "FUTURECLOUD"."T_LOGINRECORD"

  47. EXPORT:     72 rows from table "FUTURECLOUD"."T_LOG_DIRECTORY"

  48. EXPORT:   1599 rows from table "FUTURECLOUD"."T_MAC_AREACODE"

  49. EXPORT:     23 rows from table "FUTURECLOUD"."T_MESSAGESEARCH"

  50. EXPORT:    205 rows from table "FUTURECLOUD"."T_MODULE"

  51. EXPORT:  10700 rows from table "FUTURECLOUD"."T_NEWS"

  52. EXPORT:  82000 rows from table "FUTURECLOUD"."T_NUMBERSEARCH"

  53. EXPORT:   2050 rows from table "FUTURECLOUD"."T_RECEIVEMESSAGE"

  54. EXPORT:   7992 rows from table "FUTURECLOUD"."T_ROLE"

  55. EXPORT:   9216 rows from table "FUTURECLOUD"."T_ROLE_FUNCTION"

  56. EXPORT:   7400 rows from table "FUTURECLOUD"."T_SECURITYCODE"

  57. EXPORT:  51823 rows from table "FUTURECLOUD"."T_SENDMESSAGE"

  58. EXPORT:    570 rows from table "FUTURECLOUD"."T_SMS_NUMBER"

  59. EXPORT:    285 rows from table "FUTURECLOUD"."T_TIMERMESSAGE"

  60. EXPORT: 1750985 rows from table "FUTURECLOUD"."T_WEBSERVICELOG"


  61. Disconnecting from database ... successful!


  62. End time:  Wed Nov 15 14:57:21 2017

  63. D:\yjmhbak>

导出完成!


本文出自 “花之旭's Blog” 博客,谢绝转载!

以上是关于DB2数据库迁移的主要内容,如果未能解决你的问题,请参考以下文章

DB2同平台迁移数据库

数据迁移实战:基于Kettle的Mysql到DB2的数据迁移

db2 存储过程迁移方法

sqoop从DB2迁移数据到HDFS

使用Ruby从MySQL迁移到DB2

不同数据库不同表的数据迁移