查看: 23241|回复: 82

[精华] 来讨论一个recovery的问题

[复制链接]
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
跳转到指定楼层
1#
发表于 2008-11-7 21:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
10pub币
一般我们都知道,当数据库在线的时候所作的OS级别的文件系统备份是不能够用来恢复数据库的,现在俺的问题就是:WHY?

理论上来讲,如果文件系统级别的备份能够前滚到某一个特定时间点保证文件系统级别的一致性,当activate数据库的时候crash recovery不是理论上也应该能够recover么?
从文件系统的备份恢复到某一时间点与操作系统断电产生的crash有什么本质的不同,从而使得文件系统备份不能被用来恢复数据库呢?

象征性悬赏10分,奖励第一个回答正确的同学

最佳答案

查看完整内容

so you said in db2 for z, users even doesn't need to stop the database to do backup? and ibm supports that kind of backup strategy?No, user DOES NOT need to stop the database when running BACKUP SYSTEM utility, it is so-called an ONLINE utility.IBM absolutely supports this kind of backup strategy, and has a corresponding utility named RESTORE SYSTEM to recover to the PIT. However, this backup meth ...
论坛徽章:
6
2010新春纪念徽章
日期:2010-03-01 11:21:012013年新春福章
日期:2013-02-25 14:51:242014年新春福章
日期:2014-02-18 16:41:11马上有车
日期:2014-02-18 16:41:11沸羊羊
日期:2015-03-04 14:43:432015年新春福章
日期:2015-03-06 11:57:31
2#
发表于 2008-11-7 21:58 | 只看该作者
so you said in db2 for z, users even doesn't need to stop the database to do backup? and ibm supports that kind of backup strategy?
No, user DOES NOT need to stop the database when running BACKUP SYSTEM utility, it is so-called an ONLINE utility.
IBM absolutely supports this kind of backup strategy, and has a corresponding utility named RESTORE SYSTEM to recover to the PIT. However, this backup method is system scope, meaning that you can't backup a subset of data, but an entire database system. In V8, you even can recover the entire system only, in V9 you can do object-level selective recover based on system-level backup, thru RECOVER utility.
And I think this kind of backup/recover is prompted by some ERP (like SAP,People Soft) customer's requests, and it is a good method to replicate data.


do you know if the "BACKUP SYSTEM" will suspend io write activities during the backup?
No, it is an online utility, backup triggers flashcopy (or compatible disks tech) running background. There is NO impact on service availability, but some disks IO performance degrade is inevitable.  

what happen if we just run a backup from storage  (so db2 doesn't know there's backup), the backup will copy all files used by database and instance, and then can we use this set of backup to "recatalog" and recovery? (of course it's not restore, just crash recovery)
There is no need to recatalog, you have made a disk mirror including complete set of files, then you just restart your DB2 from this mirror, DB2 plays "recovery" automatically when restarted, like a crash recovery.

[ 本帖最后由 Pythagoras 于 2008-11-19 11:10 编辑 ]

使用道具 举报

回复
论坛徽章:
0
3#
发表于 2008-11-8 22:07 | 只看该作者
狼所指的OS级别的文件系统备份是不是文件系统直接copy?

使用道具 举报

回复
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
4#
 楼主| 发表于 2008-11-9 10:26 | 只看该作者
不一定是文件系统的cp,有的时候从文件系统直接用厂商提供的工具作备份比如flash copy之类的。总之就是不用db2得backup,而是用文件系统的备份工具来备份,然后恢复的时候可以根据文件系统级别的增量备份恢复到某一个特定时间点

使用道具 举报

回复
招聘 : Linux运维
论坛徽章:
235
紫蜘蛛
日期:2007-09-26 17:05:46玉兔
日期:2007-09-26 17:05:05现任管理团队成员
日期:2011-05-07 01:45:08玉兔
日期:2006-08-29 20:38:48紫蜘蛛
日期:2007-09-26 17:05:34阿斯顿马丁
日期:2013-11-19 10:38:16奔驰
日期:2013-10-16 09:08:58红旗
日期:2014-01-09 11:57:39路虎
日期:2013-08-13 14:52:35林肯
日期:2015-05-19 13:01:16
5#
发表于 2008-11-9 11:49 | 只看该作者
也许os的copy 不能把数据库的不一致的数据记录下来,
数据库备份的时候把内存中的工作单元进行了备份!这样当数据库恢复的时候就能找到不一致的数据进行恢复~!
而os的备份,只是对数据文件的备份~!恢复的时候db找不到内存中不一致的unit of work!

使用道具 举报

回复
招聘 : Linux运维
论坛徽章:
235
紫蜘蛛
日期:2007-09-26 17:05:46玉兔
日期:2007-09-26 17:05:05现任管理团队成员
日期:2011-05-07 01:45:08玉兔
日期:2006-08-29 20:38:48紫蜘蛛
日期:2007-09-26 17:05:34阿斯顿马丁
日期:2013-11-19 10:38:16奔驰
日期:2013-10-16 09:08:58红旗
日期:2014-01-09 11:57:39路虎
日期:2013-08-13 14:52:35林肯
日期:2015-05-19 13:01:16
6#
发表于 2008-11-9 11:50 | 只看该作者
我猜的啊~!等狼定夺!~

使用道具 举报

回复
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
7#
 楼主| 发表于 2008-11-9 11:54 | 只看该作者
原帖由 myfriend2010 于 2008-11-9 12:49 发表
也许os的copy 不能把数据库的不一致的数据记录下来,
数据库备份的时候把内存中的工作单元进行了备份!这样当数据库恢复的时候就能找到不一致的数据进行恢复~!
而os的备份,只是对数据文件的备份~!恢复的时候db找不到内存中不一致的unit of work!

不完全正确:)
内存中的数据可以通过crash recovery来恢复。我们的前提已经假定可以把数据文件与日志和控制文件恢复回滚到某一个特定的时间点,而db2是会在向数据文件里面写东西之前先写log,这样在transaction log里面没有提交或者已经提交而没有刷新的东西都是已经存在的,所以crash recovery理论上应该能够完全恢复的,不是么?

使用道具 举报

回复
论坛徽章:
18
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:52
8#
发表于 2008-11-10 08:17 | 只看该作者
Simply because write IO consistency. As long as write IO suspended, file system level backup, i.e. flashcopy etc. would be fine to rebuild a consistent DB.

使用道具 举报

回复
招聘 : Linux运维
论坛徽章:
235
紫蜘蛛
日期:2007-09-26 17:05:46玉兔
日期:2007-09-26 17:05:05现任管理团队成员
日期:2011-05-07 01:45:08玉兔
日期:2006-08-29 20:38:48紫蜘蛛
日期:2007-09-26 17:05:34阿斯顿马丁
日期:2013-11-19 10:38:16奔驰
日期:2013-10-16 09:08:58红旗
日期:2014-01-09 11:57:39路虎
日期:2013-08-13 14:52:35林肯
日期:2015-05-19 13:01:16
9#
发表于 2008-11-10 08:36 | 只看该作者
unixnewbie 专业

使用道具 举报

回复
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
10#
 楼主| 发表于 2008-11-10 08:36 | 只看该作者
but what happen if user didn't do IO suspend? (of course we all know it will be fine if user used IO suspend, the question is, why it's not support for such backup/recovery strategy if the database was still running)

if there are still applications connecting to the database and insert/update/delete, and users just use flash copy to create consistence-group FS backup (that means all files are consistent at a specific point-in-time, include data file, transaction logs and control files), why users cannot use this image to rebuild database? (in theory, users can use crash recovery to make transaction level consistency after the file systems being restored, correct? )

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表