Tuesday, January 11, 2011

FLUSH BEFORE TESTING

When testing it can be important to ensure that you are not running your sql from cache as this may give you false results in regard to timing. You wouldn’t want to find yourself in production saying, “well, I it ran fast in test”. Anytime you are performing any type of performance tests it is important to try and duplicate your production environment as best as you can. This is even more important when you are talking about hdd disk reads (very time-consuming in relation to memory reads).

So you are doing testing and want to know how you can flush the buffer cache within Oracle without having to bounce the database instance?

The answer is to Flush the data buffer cache.

alter system flush buffer_cache;

This is for testing and wouldn’t be a very good idea to execute it on a production system as it could have an adverse effect on performance.

No comments: