ITPub博客

首页 > 数据库 > Oracle > gc current block pin time gc current block flush time 疑惑

gc current block pin time gc current block flush time 疑惑

原创 Oracle 作者:wei-xh 时间:2015-02-05 14:29:03 0 删除 编辑
非常简单的记录,没有可读性,留作一个疑惑。


第一个节点更新数据块
第二个节点更新同样的数据块
由于是更新操作,因此需要块的current block
第二个节点像第一个节点要求current block,再发送前,第一个节点需要pin住此块,把log buffer内的内容写磁盘。
统计量里的gc current block pin time gc current block flush time分别对应了此种情况。但是我模拟的情况,发现并没有发生统计量的增加。


节点1:
test@ILSP>select
  2          statistic#,
  3          name,
  4          value
  5  from
  6          v$sysstat where statistic# in (215,216);


STATISTIC# NAME                                                                  VALUE
---------- ---------------------------------------------------------------- ----------
       215 gc current block pin time                                                68
       216 gc current block flush time                                            7019


test@ILSP>        update t_one set v1='10' where n1=265 and rownum=1;


1 row updated.


test@ILSP>
test@ILSP>select
  2          statistic#,
  3          name,
  4          value
  5  from
  6          v$sysstat where statistic# in (215,216);


STATISTIC# NAME                                                                  VALUE
---------- ---------------------------------------------------------------- ----------
       215 gc current block pin time                                                68
       216 gc current block flush time                                            7019


节点2:       
test@ILSP>select
  2          statistic#,
  3          name,
  4          value
  5  from
  6          v$sysstat where statistic# in (215,216);


STATISTIC# NAME                                                                  VALUE
---------- ---------------------------------------------------------------- ----------
       215 gc current block pin time                                                67
       216 gc current block flush time                                            6906


test@ILSP>        update t_one set v1='10' where n1=266 and rownum=1;


1 row updated.


test@ILSP>
test@ILSP>select
  2          statistic#,
  3          name,
  4          value
  5  from
  6          v$sysstat where statistic# in (215,216);


STATISTIC# NAME                                                                  VALUE
---------- ---------------------------------------------------------------- ----------
       215 gc current block pin time                                                67
       216 gc current block flush time                                            6906
       
但是,另一个场景却发生了:       


test@ILSP>begin
  2  for i in 1 ..100000 loop
  3  UPDATE  wxh_tbd SET object_name=20 where rowid='AAAVaMAAEAAABDjAAA';
  4  commit write immediate wait;
  5  end loop;
  6  end;
  7  /




test@ILSP>begin
  2  for i in 1 ..10000 loop
  3  UPDATE  wxh_tbd SET object_name=20 where rowid='AAAVaMAAEAAABDjAAB';
  4  commit write immediate wait;
  5  end loop;
  6  end;
  7  /


sys@ILSP>select
  2          statistic#,
  3          name,
  4          value
  5  from
  6          v$sysstat where statistic# in (215,216);


STATISTIC# NAME                                                                  VALUE
---------- ---------------------------------------------------------------- ----------
       215 gc current block pin time                                                72
       216 gc current block flush time                                            7502


2 rows selected.


sys@ILSP>/


STATISTIC# NAME                                                                  VALUE
---------- ---------------------------------------------------------------- ----------
       215 gc current block pin time                                                73
       216 gc current block flush time                                            7545


2 rows selected.


sys@ILSP>/


STATISTIC# NAME                                                                  VALUE
---------- ---------------------------------------------------------------- ----------
       215 gc current block pin time                                                73
       216 gc current block flush time                                            7570


2 rows selected.


sys@ILSP>/


STATISTIC# NAME                                                                  VALUE
---------- ---------------------------------------------------------------- ----------
       215 gc current block pin time                                                74
       216 gc current block flush time                                            7591


我的版本是11.2.0.3,我的猜想,可能是ORACLE做了优化,再发送current block前检查下对应的日志有没有写磁盘,如果已经写磁盘了,就不需要再去做pin和flush的操作了。
       

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22034023/viewspace-1427402/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle ACE组成员,DBGeeK用户组发起人。曾在DTCC、ORACLE技术嘉年华、Gdevops等公开场合做过数据库技术专题分享,2017年应Oracle邀请在世界最大的数据库会议OOW上做技术分享。组织翻译了《拨云见日,解密Oracle ASM内核》一书。

注册时间:2009-07-04

  • 博文量
    422
  • 访问量
    2425315