overview:
备份采用的是SSV方式。这也是IBM官方在9.5以后推荐的方式。以前版本使用的是db2_all命令执行backup,db2_all的方式有一些缺点,这里不多说,官方有详细说明。 因为新增加了SSV(单一系统视图)方式,其实使用起来很简单,就是在backup命令里加一个参数on dbpartitionnums,可以用all指定所有分区,也可以只备份某个或某几个分区。恢复的时候,仍然是采用db2_all的方式调用restore命令。先恢复编目分区,再恢复其它分区即可。rollforward则与备份命令相似,指定on all dbpartitionnums参数以后,可以直接完成rollforwardr操作。以下是实施命令,包括offline和online两种备份与恢复方式。
--offline backup
备份(backup SSV)
db2 backup db sample on all dbpartitionnums to /db2home/db2inst1/db2backup/dpf_backup/
恢复(restore)
db2_all "<<+0< db2 restore db sample from /db2home/db2inst1/db2backup/dpf_backup/ taken at 20141203003309 without rolling forward"
db2_all "<<-0< db2 restore db sample from /db2home/db2inst1/db2backup/dpf_backup/ taken at 20141203003309 without rolling forward"
--online backup
备份(backup)
db2 backup db sample on all dbpartitionnums online to /db2home/db2inst1/db2backup/dpf_backup/
恢复(restore)
db2_all "<<+0< db2 restore db sample from /db2home/db2inst1/db2backup/dpf_backup/ taken at 20141203003516 logtarget /db2home/db2inst1/db2backup/dpf_backup/db2log/"
db2_all "<<-0< db2 restore db sample from /db2home/db2inst1/db2backup/dpf_backup/ taken at 20141203003516 logtarget /db2home/db2inst1/db2backup/dpf_backup/db2log/"
前滚(rollforward)
db2 "rollforward db sample to end of backup on all dbpartitionnums and stop overflow log path(/db2home/db2inst1/db2backup/dpf_backup/db2log/)"
阅读(5512) | 评论(0) | 转发(0) |