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/