Solved

Disable Caching in Oracle 10g

Posted on 2011-02-11
9
1,772 Views
Last Modified: 2012-05-11
Hi All,

I was wondering if there's anyway to turn off at instance/machine level, caching in Oracle10g? I'm trying to run a series of data simulations, which requires performance analysis without caching or other optimization from Oracle.

I was wondering besides caching, is there any other things that I should disable?

Cheers
0
Comment
Question by:chongchian
  • 5
  • 2
  • 2
9 Comments
 
LVL 48

Accepted Solution

by:
schwertner earned 170 total points
ID: 34869806
Oracle level caches:

Oracle caches (placed in System Global area) can not be turned off. You can only increase or decrease the size of these caches.
Also you can command the size of online redo log files.


OS level caches:

On Unix the OS caches in the "free" RAM disk extents. This can not be command by you.
0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 170 total points
ID: 34870802
you can flush the shared pool

for data caching,  you can't disable or flush it, but you can fill the cache with dummy data,  create a dummy table and read from it until your cache is filled with nothing but blocks from that table.

of course, restarting the database will flush everything too
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34870811
are you sure your analysis will be valid without caching?

In normal execution, caching is regular and expected occurence.
If you artificially wipe it out, you may be creating an "even playing field" but still skewing your results.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 160 total points
ID: 34870964
As mentioned earlier, bouncing the database is the best way to get a pristine memory structure.  Depending on exactly what you are wanting to test, in addition to flushing the shared pool, flush the buffer cache.

I agree that a cleared cache might skew your results but for testing variations of SQL performance, I flush my caches.

alter system flush shared_pool;
alter system flush buffer_cache;
0
 
LVL 48

Expert Comment

by:schwertner
ID: 34871002
Data cache flush could also be done:

alter system flush buffer_cache;

Another  cleanup statements:

alter system flush buffer_cache;

alter system switch logfile;




0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34871030
>>  alter system flush buffer_cache;

I stand corrected, that's better  than trying to fill it with dummy data

I've never wanted to flush my buffer cache, so never bothered to look it up.

If anything I've wanted to seed the cache for my tests.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 34871056
The only time I've ever flushed buffer cache is when I'm wanting to test variations in SQL (different hints/indexes/functions/???) and don't want any table blocks in memory between runs.

This gets even tricker in 11g with results caching.  Flushing that isn't an 'alter system'.
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34871121
if result_cache_mode init param is set to MANUAL (the default)  nothing will be cached automatically.

and for individual queries you can use /*+ NO_RESULT_CACHE */ hint
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34871154
also  result_cache_max_result  can bet set to 0, which should also effectively disable result caching since 0% of memory would be usable
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question