如何禁用Oracle缓存进行性能测试 [英] How to disable oracle cache for performance tests

查看:577
本文介绍了如何禁用Oracle缓存进行性能测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的数据测试新汇总表的实用性.

I'm trying to test the utility of a new summary table for my data.

因此,我创建了两个过程来获取一定间隔的数据,每个过程使用不同的表源.因此,在我的C#控制台应用程序上,我只调用了一个或另一个.当我想重复几次以形成良好的响应时间时,问题就开始了.

So I've created two procedures to fetch the data of a certain interval, each one using a different table source. So on my C# console application I just call one or another. The problem start when I want to repeat this several times to have a good pattern of response time.

我得到了这样的东西:1199,84,81,81,81,81,82,80,80,81,81,80,81,91,80,80,81,80

I got something like this: 1199,84,81,81,81,81,82,80,80,81,81,80,81,91,80,80,81,80

我的Oracle 10g可能正在进行不适当的缓存.

Probably my Oracle 10g is making an inappropriate caching.

我该如何解决?

推荐答案

编辑:请参见

See this thread on asktom, which describes how and why not to do this.

如果您处于测试环境中,则可以使表空间脱机并再次联机:

If you are in a test environment, you can put your tablespace offline and online again:

ALTER TABLESPACE <tablespace_name> OFFLINE;
ALTER TABLESPACE <tablespace_name> ONLINE;

或者您可以尝试

ALTER SYSTEM FLUSH BUFFER_CACHE;

但仅限于测试环境.

在真实"系统上进行测试时,第一次调用后(使用缓存数据的时间)所获得的时间可能会更有趣,因为您将缓存数据.调用该过程两次,并且仅考虑在后续执行中获得的性能结果.

When you test on your "real" system, the times you get after first call (those using cached data) might be more interesting, as you will have cached data. Call the procedure twice, and only consider the performance results you get in subsequent executions.

这篇关于如何禁用Oracle缓存进行性能测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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