暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Is it possible to flush data from the db_block_buffer for testing purposes.

2011-01-01
532

The Oracle (tm) Users' Co-Operative FAQ

Is is possible to flush the db_block_buffer for testing purposes


Author's name: Jonathan Lewis

Author's Email: Jonathan@jlcomp.demon.co.uk

Date written: 28th March 2002

Oracle version(s): 8.1.7

It is well-known that you can use alter system flush shared_pool; to clear the library cache of recently execute SQL etc. But is there an equivalent option for clearing the db_block_buffer in order to test the effects of changing execution paths without getting accidental benefits from buffered data ?.


There is no matching command, however there is a little trick which may be adequate.

	alter tablespace XXX offline;
	alter tablespace XXX online;

When you alter the tablespace offline, any blocks which are in the buffer are invalidated, and therefore subject to rapid elimination as the buffer is re-used. In fact, even when you bring the tablespace back online, even if some blocks are still apparently buffered, they cannot be reused.

Bear in mind, though, that if you are running Oracle on a file-system, and not using direct I/O as the O/S level, then the blocks may still be buffered in the file-system buffer; so your tests may still suffer from some spurious buffering benefit; especially if your code is accessing some smallish tables through tablescans. Remember that a small table is one that is no more that 2% of the size of the db_block_buffer, it is NOT, as is commonly believed, one that is only four blocks or less..


Further reading: N/A



最后修改时间:2020-04-16 15:12:41
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论