加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

理解 alter system flush buffer_cache;

(2014-05-25 00:11:24)
标签:

it

分类: SAP_Basis
理解 alter system flush buffer_cache;

SQL> set timing on       
SQL> set autot trace statistic;
SQL> select count(*) from emp;
Elapsed: 00:00:00.04
Statistics
----------------------------------------------------------
          4  recursive calls
          0  db block gets
         13  consistent gets
          8  physical reads
          0  redo size
        526  bytes sent via SQL*Net to client
        524  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed


SQL> select count(*) from emp;
Elapsed: 00:00:00.01
Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          4  consistent gets
          0  physical reads
          0  redo size
        526  bytes sent via SQL*Net to client
        524  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed



SQL> alter system flush buffer_cache;
System altered.
Elapsed: 00:00:00.07

SQL>  select count(*) from emp;
Elapsed: 00:00:00.04
Statistics
----------------------------------------------------------
          4  recursive calls
          0  db block gets
         13  consistent gets
          8  physical reads
          0  redo size
        526  bytes sent via SQL*Net to client
        524  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed

更多可参考:http://blog.itpub.net/519536/viewspace-623381
提醒:
(1)当Buffer Cache包含大量数据时,刷新时间将会很长,没有“特殊需求”请不要使用这个方法,不建议在生产环境这样干!
(2)该方法在进行SQL性能测试时较为常用,为排除Buffer Cache对于测试结果影响时可以考虑使用该方法强制Oracle重新执行物理读。

0

阅读 收藏 喜欢 打印举报/Report
后一篇:《专业主义》
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有