DB2同平台迁移数据库

[appinst@dbsvr1 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
[appinst@reportsvr ~]$ db2 create db EATZ using codeset GBK territory CN
DB20000I  The CREATE DATABASE command completed successfully.

[appinst@reportsvr ~]$ 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') 
 
 
 

 

转载于:https://www.cnblogs.com/houzhiqing/p/11096854.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值