|
原帖由 Yong Huang 于 2008-6-19 06:06 发表 ![]()
How about checking v$bh.dirty instead of status before and after flush_cache and checkpoint?
Yong Huang
I did a test in 10.2.0.1 database. I keep checking x$bh.flag:
select flag, count(*) from x$bh group by flag order by 1;
while I do flush buffer_cache and checkpoint. The flag column is documented at
http://www.jlcomp.demon.co.uk/buf_flag.html
It looks like flush buffer_cache does much more than checkpoint. Flushing cache reduces count of buffers with flags such as 8192 (gotten_in_current_mode), 524288 (only_sequential_access) and 33562625 (dirty and gotten_in_current_mode and redo_since_read). Checkpoint, on the other hand, does much less, but it does reduce dirty buffers.
I don't know much about some of the obscure (uncommon) flags. But it looks like flush buffer_cache does what checkpoint does, plus more. Then the question is How do we explain lozity's test (see his messages at 2008-6-17 16:46 and 2008-6-17 20:23)? Maybe I misunderstood his test.
Even if flush cache writes dirty buffers to datafiles as checkpoint does (as I guessed), Oracle does not consider it as a checkpoint. In my test, v$sysstat does not show increase for
DBWR checkpoints
background checkpoints started
background checkpoints completed
and only increases
physical writes non checkpoint.
If I can check the content of the checkpoint queue, it's possible flush buffer_cache does not change it.
Can jingjingxiaomei or biti_rainy shed some light on this? You have done more research on buffer cache than I.
Yong Huang |
|