如何清除Oracle中的所有缓存项目 [英] How to clear all cached items in Oracle

查看:740
本文介绍了如何清除Oracle中的所有缓存项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调整Oracle数据库上的SQL查询.我想确保在运行每个查询之前清除所有缓存的项目,以防止误导性能结果.我通过运行以下命令清除共享池(摆脱缓存的SQL/解释计划)和缓冲区缓存(摆脱缓存的数据):

I'm tuning SQL queries on an Oracle database. I want to ensure that all cached items are cleared before running each query in order to prevent misleading performance results. I clear out the shared pool (to get rid of cached SQL/explain plans) and buffer cache (to get rid of cached data) by running the following commands:

alter system flush buffer_cache;
alter system flush shared_pool;

我还有更多要做的事情吗?

Is there more I should be doing, or is this sufficient?

谢谢!

推荐答案

刷新共享池应该可以做到,但是Tom Kyte列举了以下几个原因,在某些情况下您可能无法获得预期的结果:

Flushing the shared pool should do it, but Tom Kyte lists a couple reasons below why you may not get the result you are expecting in some cases:

http://asktom .oracle.com/pls/asktom/f?p = 100:11:0 ::::: P11_QUESTION_ID:6349391411093

这篇关于如何清除Oracle中的所有缓存项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆