123
返回列表 发新帖
楼主: lozity

关于块清除的一个问题,谢谢

[复制链接]
论坛徽章:
14
奥运会纪念徽章:自行车
日期:2008-04-25 21:00:142013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-10 13:11:14奥运会纪念徽章:皮划艇激流回旋
日期:2012-08-13 10:25:38鲜花蛋
日期:2012-02-10 11:40:172010新春纪念徽章
日期:2010-03-01 11:04:58授权会员
日期:2010-01-12 09:40:47ITPUB元老
日期:2010-01-12 09:33:092009新春纪念徽章
日期:2009-01-04 14:52:28奥运会纪念徽章:拳击
日期:2008-10-24 13:22:33
21#
发表于 2008-6-27 15:18 | 只看该作者
flush行为也许就像它的字面意思----如同一个冲马桶的动作:所有赃物冲出去,再将清水引进来。

但是仍然不明白下面的结果,为什么仅仅alter system checkpoint之后,xcur的buffer会增加?

SQL> select status,count(*) from v$bh group by status;

STATU   COUNT(*)
----- ----------
free       12001
xcur          11

SQL> alter system checkpoint;

系统已更改。

SQL> select status,count(*) from v$bh group by status;

STATU   COUNT(*)
----- ----------
free       11970
xcur          42

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
22#
发表于 2008-6-28 01:15 | 只看该作者
原帖由 solearn 于 2008-6-27 01:18 发表
但是仍然不明白下面的结果,为什么仅仅alter system checkpoint之后,xcur的buffer会增加?


How reproducible is it? Always state you Oracle version.

Yong Huang

使用道具 举报

回复
论坛徽章:
14
奥运会纪念徽章:自行车
日期:2008-04-25 21:00:142013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-10 13:11:14奥运会纪念徽章:皮划艇激流回旋
日期:2012-08-13 10:25:38鲜花蛋
日期:2012-02-10 11:40:172010新春纪念徽章
日期:2010-03-01 11:04:58授权会员
日期:2010-01-12 09:40:47ITPUB元老
日期:2010-01-12 09:33:092009新春纪念徽章
日期:2009-01-04 14:52:28奥运会纪念徽章:拳击
日期:2008-10-24 13:22:33
23#
发表于 2008-6-28 11:23 | 只看该作者
原帖由 Yong Huang 于 2008-6-28 01:15 发表


How reproducible is it? Always state you Oracle version.

Yong Huang


It was on Oracle 9.2.0.1 on winxp.

使用道具 举报

回复
论坛徽章:
14
奥运会纪念徽章:自行车
日期:2008-04-25 21:00:142013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-10 13:11:14奥运会纪念徽章:皮划艇激流回旋
日期:2012-08-13 10:25:38鲜花蛋
日期:2012-02-10 11:40:172010新春纪念徽章
日期:2010-03-01 11:04:58授权会员
日期:2010-01-12 09:40:47ITPUB元老
日期:2010-01-12 09:33:092009新春纪念徽章
日期:2009-01-04 14:52:28奥运会纪念徽章:拳击
日期:2008-10-24 13:22:33
24#
发表于 2008-6-28 11:51 | 只看该作者
I tried on a 10g box. It is a bit different. Maybe "alter system checkpoint" itself causes xcur increase. But immediately after flush, there is still '1' xcur while in my 9i test there was no xcur.

SQL> startup
ORACLE instance started.

Total System Global Area  335544320 bytes
Fixed Size                  1219304 bytes
Variable Size             213910808 bytes
Database Buffers          117440512 bytes
Redo Buffers                2973696 bytes
Database mounted.

Database opened.
SQL> SQL> select status,count(*) from v$bh group by status;

STATUS    COUNT(*)
------- ----------
xcur          3891
free            63
read             1
cr             140

SQL> alter system checkpoint;

System altered.

SQL> select status,count(*) from v$bh group by status;

STATUS    COUNT(*)
------- ----------
xcur          9705
free            63
cr             638

SQL> alter system flush cache;
alter system flush cache
*
ERROR at line 1:
ORA-02000: missing SHARED_POOL/BUFFER_CACHE/GLOBAL CONTEXT keyword


SQL> alter system set events 'immediate trace name flush_cache';

System altered.

SQL> select status,count(*) from v$bh group by status;

STATUS    COUNT(*)
------- ----------
xcur             1
free         10405

SQL> /

STATUS    COUNT(*)
------- ----------
xcur             1
free         10405

SQL> alter system checkpoint;

System altered.

SQL> select status,count(*) from v$bh group by status;

STATUS    COUNT(*)
------- ----------
xcur            67
free         10339

SQL> select count(*) from all_tables;

  COUNT(*)
----------
      1583

SQL> select status,count(*) from v$bh group by status;

STATUS    COUNT(*)
------- ----------
xcur          1739
free          8667

SQL>

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
25#
发表于 2008-7-1 01:33 | 只看该作者
solearn,

Sorry. Neither I nor eagle_fan can reproduce your test, in 10g and 11g. Before and after our checkpoint, "select status,count(*) from v$bh group by status" does not show any difference. There must be something special about your database.

Yong Huang

使用道具 举报

回复
论坛徽章:
14
奥运会纪念徽章:自行车
日期:2008-04-25 21:00:142013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-10 13:11:14奥运会纪念徽章:皮划艇激流回旋
日期:2012-08-13 10:25:38鲜花蛋
日期:2012-02-10 11:40:172010新春纪念徽章
日期:2010-03-01 11:04:58授权会员
日期:2010-01-12 09:40:47ITPUB元老
日期:2010-01-12 09:33:092009新春纪念徽章
日期:2009-01-04 14:52:28奥运会纪念徽章:拳击
日期:2008-10-24 13:22:33
26#
发表于 2008-7-1 10:05 | 只看该作者
I did the test on my 9i, this time I got a different result:


SQL> alter system checkpoint;

System altered.

SQL> select status,count(*) from v$bh group by status;

STATU   COUNT(*)
----- ----------
cr             2
free       10312
xcur        1698

SQL> /

STATU   COUNT(*)
----- ----------
cr             2
free       10312
xcur        1698

SQL> alter system set events 'immediate trace name flush_cache';

System altered.

SQL> select status,count(*) from v$bh group by status;

STATU   COUNT(*)
----- ----------
free       12012

SQL> alter system checkpoint;

System altered.

SQL> select status,count(*) from v$bh group by status;

STATU   COUNT(*)
----- ----------
free       12012

SQL> /

STATU   COUNT(*)
----- ----------
free       12012

SQL>

It seems that 'flush_cache' eliminate all cr and xcur buffers, there are only free buffer left. And 'alter system checkpoint' leads to no new xcur buffers. The only difference between those two experiments is the latter one was done just after a OS and db restart. But I cannot believe this is the reason.

使用道具 举报

回复

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

本版积分规则 发表回复

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