DB2的冷备份、在线全备份和在线增量备份

1.冷备份
[1].断开所有连接
db2 force application all
[2].备份数据库
db2 backup db <数据库名称>
eg:db2 backup db sedm
2.在线备份
[1].设置在线备份
A.命令
db2 update db cfg for <数据库名> using logarchmeth1 <归档日志的目录>
eg: db2 update db cfg for sedm using logarchmeth1 DISK:D:\backup
B.重启数据库
db2stop force
db2start
C.冷备份一次
D.经过A,B,C 3部之后就可以使用在线备份了
[2].全备份
db2 backup db <数据库名> online to <数据库备份放置目录> include logs
eg:db2 backup db sedm online to E:\backup include logs

[3].增量备份
db2 backup db <数据库名> online incremental to <数据库备份放置目录> include logs
eg:db2 backup db sedm online incremental to E:\backup include logs

你可能感兴趣的:(db2)