Skip to Main Content

Flush cache

In Oracle 10g and beyond, this command will flush the buffer cache:
alter system flush buffer_cache;
Note: Flushing the data buffer cache imposes a serious performance overhead, especially on RAC databases. Using the flush buffer cache was intended only for test system.
The following example shows the effect of flush buffer_cache (run this before and after the "alter system flush buffer_cache" statement):

When testing the SQL it is a good idea to periodically flush the shared pool to remove older execution plans: Note: "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.": https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7413988573867 and https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6349391411093

Sources:
http://www.dba-oracle.com/t_flush_buffer_cache.htm
http://stackoverflow.com/questions/2147456/how-to-clear-all-cached-items-in-oracle