DB2同平台迁移数据库

Posted houzhiqing

tags:

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

[[email protected] bakdata]$ db2 backup db EATH online to /tmp/bakdata/ include logs without prompting

Backup successful. The timestamp for this backup image is : 20190611173438

 db2pd -db EATH -tab
Address            TspId ContainNum Type    TotalPgs   UseablePgs PathID     StripeSet  Container 
0x00007F4C860A74A0 0     0          File    32768      32764      0          0          /data/database/appinst/NODE0000/EATH/T0000000/C0000000.CAT
0x00007F4C860A8BC0 1     0          Path    1          1          0          0          /data/database/appinst/NODE0000/EATH/T0000001/C0000000.TMP
0x00007F4C860AC360 2     0          File    49152      49120      0          0          /data/database/appinst/NODE0000/EATH/T0000002/C0000000.LRG
0x00007F4C860ADAE0 3     0          File    8192       8188       0          0          /data/database/appinst/NODE0000/EATH/T0000003/C0000000.LRG
0x00007F4C860AF260 4     0          File    1024       992        0          0          /data/database/appinst/NODE0000/EATH/T0000004/C0000000.LRG
0x00007F4C860B09E0 5     0          File    16384      16368      0          0          /data/database/appinst/NODE0000/EATH/T0000005/C0000000.USR
0x00007F4C860B2100 6     0          Path    1          1          0          0          /data/database/appinst/NODE0000/EATH/T0000006/C0000000.UTM





db2ckbkp -h  EATH.0.appinst.NODE0000.CATN0000.20190611173438.001 | more  

db2 create db EATZ using codeset GBK territory CN

--从EATH恢复到EATZ
mkdir /data/EATZ
[[email protected] ~]$ db2 create db EATZ using codeset GBK territory CN
DB20000I  The CREATE DATABASE command completed successfully.

[[email protected] ~]$ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.7.9

You can issue database manager commands and SQL statements from the command 
prompt. For example:
    db2 => connect to sample
    db2 => bind sample.bnd

For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
 ? CATALOG DATABASE for help on the CATALOG DATABASE command
 ? CATALOG          for help on all of the CATALOG commands.

To exit db2 interactive mode, type QUIT at the command prompt. Outside 
interactive mode, all commands must be prEAixed with db2.
To list the current command option settings, type LIST COMMAND OPTIONS.

For more detailed help, rEAer to the Online REAerence Manual.

db2 => connect to EATZ

   Database Connection Information

 Database server        = DB2/LINUXX8664 9.7.9
 SQL authorization ID   = APPINST
 Local database alias   = EATZ


RESTORE DATABASE EATH FROM /tmp/bakdata taken at 20190611173438 on /data/EATZ INTO EATZ LOGTARGET /tmp/bakdata
 
 
 db2pd -util
 
ROLLFORWARD db EATZ TO END OF LOGS AND COMPLETE OVERFLOW LOG PATH (/tmp/bakdata) 
 
 
 

 

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

DB2数据库迁移

CloudCanal 落地 DB2 数据迁移同步功能

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

sqoop从DB2迁移数据到HDFS

Oracle 跨平台同字节序RMAN迁移(RAC To Single Instance)

db2 存储过程迁移方法