关于我们
技术分享
技术分享
在线备份和恢复的几个注意的问题
在线备份和恢复的几个注意的问题
2021-06-27
1.在在线备份恢复中,日志非常重要!创建数据库的时候缺省的是循环日志,这类型的数据库只能做完整的脱机备份
2.归档日志记录是针对前滚恢复使用的,归档日志曾经是活动的,这样也支持联机备份
3.数据库恢复时间戳的问题
UTC时间比本地时间快8小时,在恢复时候最好在备份时间点-8
db2 backup database sample online to /backup/ include logs
Backup successful. The timestamp for this backup image is : 20100626203608
Backup successful. The timestamp for this backup image is : 20100626203608
那么utc时间就是 20100626123608
如果不知道这个时间的话,阔以在db2 restore database sample from /backup/ to /dbpath
之后
db2 rollforward db sample query status
那么显示的就是utc时间
Input database alias = sample
Number of nodes have returned status = 1
Node number = 0
Rollforward status = DB pending
Next log file to be read = S0004954.LOG
Log files processed = -
Last committed transaction = 2010-06-26-12.36.08.000000 UTC
Node number = 0
Rollforward status = DB pending
Next log file to be read = S0004954.LOG
Log files processed = -
Last committed transaction = 2010-06-26-12.36.08.000000 UTC
这里也阔以看见第一活动日志是S0004954.LOG,接下来需要做的是将归档后的第一活动日志copy到当期日志路径下面
4.继续前滚:db2 rollforward db sample to db2 rollforward db sample to 2010-06-26-20.37.17 and complete
或者用下面的命令:db2 rollforward db sample to 2010-06-26-20.37.17 using local time and complete
db2 rollforward db sample complete
5. 在做日志前滚操作的时候,最好将当前日志里面的其他日志删除,归档日志里面的日志备份,然后删除里面的日志!
总之:最好将归档备份两份,并且不同的路径下面!
- 标签:
-
容灾备份
您可能感兴趣的新闻 换一批
热门文章
现在下载,可享30天免费试用