查看: 11087|回复: 24

困惑中,logfile switch产生的checkpoint到底是增量的还是完全的呢?

[复制链接]
论坛徽章:
0
跳转到指定楼层
1#
发表于 2008-9-10 20:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
无聊中研究checkpoint,困惑于logfile switch到底产生那种类型的checkpoint,google+asktom+metalink+咨询数位大佬后发现有下面几种意见,但是都缺少有说服力的文档说明
1、绝对就是普通的增量checkpoint,完全checkpoint怎么会要那么长的时间呢
2、是增量checkpoint但是是会更新scn信息的那种
3、当然是完全的啦,只不过是属于优先级比较低的那种,不会推动dbwr立即写数据文件,所以完成时间较长



不知道坛中各位大佬是什么意见,都支持那种说法呢?希望各位在说出自己意见同时给出强有力的证明。
论坛徽章:
57
马上加薪
日期:2014-02-19 11:55:142011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:502011新春纪念徽章
日期:2011-01-25 15:41:01ITPUB9周年纪念徽章
日期:2010-10-08 09:28:522010系统架构师大会纪念
日期:2010-09-03 16:39:572010数据库技术大会纪念徽章
日期:2010-05-13 10:04:272010新春纪念徽章
日期:2010-03-01 11:21:02
2#
发表于 2008-9-10 20:40 | 只看该作者
The incremental checkpoint technique uses the same data
structures that are used by conventional checkpoints. It
exploits the fact that the dirty buffers in the cache are
linked in low RBA order. If DBWR continually writes
buffers from the head of the checkpoint queue, the instance
checkpoint (lowest low-RBA of the modified buffers) will
keep advancing. Periodically, CKPT can record this lowest
low-RBA to the control file (using a very lightweight control-
file update protocol). This periodically recorded lowest
low RBA is the current position of the incremental
checkpoint for the instance. Since the incremental checkpoint
is performed continuously, the value of the incremental
checkpoint RBA will be much closer to the tail of
the log than the RBA of a “conventional” checkpoint, thus
limiting the amount of recovery needed. When incremental
checkpointing is enabled, DBWR keeps writing buffers
from the checkpoint queues in ascending low RBA order
in addition to performing other writing activity. In addition,
the CKPT process periodically records the progress
of the incremental checkpoint in the control file. By controlling
the rate at which buffers are written, we can reduce
the overhead for incremental checkpoint. Quite often,
writing buffers in ascending low RBA order also performs
LRU replacement writes and vice versa. Hence, aging
writes and checkpoint writes can complement each other.

使用道具 举报

回复
论坛徽章:
0
3#
 楼主| 发表于 2008-9-10 21:36 | 只看该作者
感谢周版主的回复
-----------

下面这些操作将会触发checkpoint事件:
日志切换,
通过ALTER SYSTEM SWITCH LOGFILE。
DBA发出checkpoint命令,通过ALTER SYSTEM checkpoint。
对数据文件进行热备时,针对该数据文件的checkpoint也会进行,ALTER TABLESPACE TS_NAME BEGIN BACKUP/END BACKUP。
当运行ALTER TABLESPACE/DATAFILE READ ONLY的时候。
SHUTDOWN命令发出时。  

完全检查点:
定义:清除脏列表(DIRTY LIST OR CHECKPOINT ENQUEUE)中所有数据块。
什么时候发生:ALTER SYSTEM CHECKPOINT; SHUTDOWN;  

--------------

这是其中的一个观点,说完全checkpoint只在上面说的两种情况下发生,没有logfile switch。

使用道具 举报

回复
论坛徽章:
0
4#
 楼主| 发表于 2008-9-11 11:55 | 只看该作者

认为是完全的观点

日志切换时的检查点

-- 我们先做一次日志切换
ALTER SYSTEM SWITCH LOGFILE;

-- 然后看看alert里面的记录
Mon Aug  4 22:31:39 2008
Beginning log switch checkpoint up to RBA [0x9.2.10], SCN: 534450
Thread 1 advanced to log sequence 9
  Current log# 2 seq# 9 mem# 0: /u/app/oracle/oradata/orcl/redo02.log
Mon Aug  4 22:35:58 2008
Completed checkpoint up to RBA [0x9.2.10], SCN: 534450

-- 我们能看到checkpoint是在过了一段时间(这里是4分钟)之后才完成的

-- 接着我们来看下V$DATAFILE_HEADER中的结果
NO  STATUS  TABLESPACE_NAME  CUR_SCN  RST_DT              RST_SCN  CKPT_DT             CKPT_SCN  CKPT_CNT
--- ------- ---------------- -------- ------------------- -------- ------------------- --------- ---------
1   ONLINE  SYSTEM           534770   2008-01-12 16:51:53 446075   2008-08-04 22:31:44 534450    67
2   ONLINE  UNDOTBS1         534770   2008-01-12 16:51:53 446075   2008-08-04 22:31:44 534450    30
3   ONLINE  SYSAUX           534770   2008-01-12 16:51:53 446075   2008-08-04 22:31:44 534450    67
4   ONLINE  USERS            534770   2008-01-12 16:51:53 446075   2008-08-04 22:31:44 534450    66
5   ONLINE  EXAMPLE          534770   2008-01-12 16:51:53 446075   2008-08-04 22:31:44 534450    26

-- 在这里我们能发现下V$DATAFILE_HEADER里面记录的SCN和日志切换发生的checkpoint的SCN是一样的,
-- 这就证明了日志切换是会更新数据文件头的,同时日志切换的checkpoint是一个级别比较低的操作,
-- 它不会立即完成,这也是出于性能上考虑的。

使用道具 举报

回复
论坛徽章:
18
ITPUB元老
日期:2005-02-28 12:57:002010年世界杯参赛球队:南非
日期:2010-04-19 12:17:452010新春纪念徽章
日期:2010-03-01 11:05:01生肖徽章2007版:牛
日期:2009-11-02 17:04:55祖国60周年纪念徽章
日期:2009-10-09 08:28:00生肖徽章2007版:兔
日期:2008-09-22 19:33:40奥运会纪念徽章:蹦床
日期:2008-09-09 11:00:24奥运会纪念徽章:跳水
日期:2008-06-16 06:59:25ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44数据库板块每日发贴之星
日期:2007-10-08 01:03:42
5#
发表于 2008-9-11 11:56 | 只看该作者

使用道具 举报

回复
论坛徽章:
0
6#
 楼主| 发表于 2008-9-11 16:42 | 只看该作者
checkpoint_instructors.ppt里面的观点是这个(P26)

CKPT also writes the checkpoint position to the datafile headers but only after a log switch.  
Note: log switch does not cause a full checkpoint.

使用道具 举报

回复
论坛徽章:
2
2011新春纪念徽章
日期:2011-02-18 11:42:49双黄蛋
日期:2012-02-13 14:32:20
7#
发表于 2008-9-11 16:47 | 只看该作者
增量 CHECKPOINT;

使用道具 举报

回复
论坛徽章:
76
双子座
日期:2015-07-28 14:26:072012新春纪念徽章
日期:2012-02-13 15:09:52ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15鲜花蛋
日期:2011-08-26 02:02:24管理团队成员
日期:2011-05-07 01:45:082010广州亚运会纪念徽章:皮划艇
日期:2011-04-18 11:24:412011新春纪念徽章
日期:2011-02-18 11:43:342011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:15
8#
发表于 2008-9-11 17:12 | 只看该作者
增量 CHECKPOINT

使用道具 举报

回复
论坛徽章:
18
ITPUB元老
日期:2005-02-28 12:57:002010年世界杯参赛球队:南非
日期:2010-04-19 12:17:452010新春纪念徽章
日期:2010-03-01 11:05:01生肖徽章2007版:牛
日期:2009-11-02 17:04:55祖国60周年纪念徽章
日期:2009-10-09 08:28:00生肖徽章2007版:兔
日期:2008-09-22 19:33:40奥运会纪念徽章:蹦床
日期:2008-09-09 11:00:24奥运会纪念徽章:跳水
日期:2008-06-16 06:59:25ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44数据库板块每日发贴之星
日期:2007-10-08 01:03:42
9#
发表于 2008-9-11 17:13 | 只看该作者
别光说个增量,解释一下为什么

使用道具 举报

回复
论坛徽章:
11
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44生肖徽章2007版:牛
日期:2008-09-21 09:12:21授权会员
日期:2008-09-27 13:54:15奥运会纪念徽章:足球
日期:2008-10-24 13:28:14生肖徽章2007版:猴
日期:2009-03-10 21:16:26生肖徽章2007版:猴
日期:2009-03-10 21:23:27生肖徽章2007版:狗
日期:2009-03-25 16:16:34
10#
发表于 2008-9-11 17:44 | 只看该作者
顶,看来也需要再对check_point了解一下了。

使用道具 举报

回复

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

本版积分规则 发表回复

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