DB2数据库的备份与恢复

1 离线全备份数据库[@more@]1 离线全备份数据库 db2 force application all db2 terminate db2stop db2start db2 backup db netdb to "/home/db2inst1/db2backup/" 恢复离线全备份数据库: db2 restore db netdb from "/home/db2inst1/db2backup/" taken at 20070723113848 without rolling forward 2 在线全备份数据库: db2 backup db netdb online to "/home/db2inst1/db2backup/" 恢复离线全备份数据库,必须前滚: db2 restore db netdb from "/home/db2inst1/db2backup/" taken at 20070723113848 without rolling forward SQL2537N “复原”后必需前滚 db2 restore db netdb from "/home/db2inst1/db2backup/" taken at 20070720170247 db2 rollforward db netdb to 2007-07-23-03.39.26.000000 and stop 3 增量备份数据库前需: db2 update db cfg for netdb using userexit on db2 update db cfg for netdb using logretain on db2 update db cfg for netdb using trackmod on 离线全备一次数据库: db2 force application all db2 terminate db2stop db2start db2 backup db netdb to to "/home/db2inst1/db2backup/" 在线增量备份数据库: db2 backup db netdb online incremental to "/home/db2inst1/db2backup/" 拷贝在线日至至数据库备份目录: cp /home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR /home/db2inst1/db2backup/logbackup 恢复数据库的备份记录: db2 restore db netdb history file from "/home/db2inst1/db2backup/" taken at 20070723102653 让数据库分析得出一个建议、可行的恢复方案: db2ckrst -d netdb -t 20070720170247 -r database 分析结果如下: Suggested restore order of images using timestamp 20070723102653 for database netdb. ==================================================================== restore db netdb incremental taken at 20070723102653 restore db netdb incremental taken at 20070720170247 restore db netdb incremental taken at 20070723102653 ==================================================================== 使用建议方案恢复数据库: db2 restore db netdb incremental from "/home/db2inst1/db2backup/" taken at 20070723102653 db2 restore db netdb incremental from "/home/db2inst1/db2backup/" taken at 20070720170247 db2 restore db netdb incremental from "/home/db2inst1/db2backup/" taken at 20070723102653 显示数据库最后commit的时间: db2 rollforward db netdb 选择从最后commit到20070723102653前的任意时间点前滚: db2 rollforward db netdb to 2007-07-23-02.27.04.000000 and sotp

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9043660/viewspace-978433/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9043660/viewspace-978433/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值