Page cache

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Page cache

satish
Dear Erman,

We are running 12.1.0.2 oracle database on redhat linux 7.Please clarify

1)What is the use of cache?
2)Will this reduce the physical reads by holding frequently accessed data blocks?
3)If yes,we have SGA for the same purpose right?
4)Will this cache gets the memory from ram or disk?

$ free -m
             total       used       free     shared    buffers     cached
Mem:          2026       1922        103          0        491       1109
-/+ buffers/cache:        322       1703
Swap:         4094          0       4094

Thank you
Sri
Reply | Threaded
Open this post in threaded view
|

Re: Page cache

Sri
Dear erman,

Will page cache hold only os files related data or will it hold data blocks as well?

This memory will be taken from ram?

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Page cache

ErmanArslansOracleBlog
Administrator
Page Cache is the cache in Os.
It holds file related data to accelerate the accesses to files on non-volatile storages.
Page Cache also holds unused areas of memory.
You can think Page Cache as the Buffer cache of the OS.
Page Cache is in memory.
Reply | Threaded
Open this post in threaded view
|

Re: Page cache

ErmanArslansOracleBlog
Administrator
SGA is another level.
Having SGA (buffer cache) + Os page cache means double buffering.
However, if you use ASM, you may bypass this double buffering thing.

ASM uses Direct IO .. It does not use a cache. Without ASM, yhen you write, OS writes it into the cache, but Oracle has a cache too.. These caches ignore eachother.. This situation ends up with double buffering.. We dont have double buffering in ASM.
Reply | Threaded
Open this post in threaded view
|

Re: Page cache

satish
This post was updated on .
Dear Erman,

Cache data in Oracle data buffer cache and again in file system buffer cache is wasting of memory by double caching.

Please correct us if our understanding is wrong

1)So,If the data required for a query is both in file system cache and in oracle database buffer cache,then in this case oracle always choose oracle data buffer cache

2)If data is not in Oracle data buffer cache but present in file system buffer cache,then oracle reads the data from file system buffer cache

3)Is OS cache and disk cache same?

Thanks,
satish
Reply | Threaded
Open this post in threaded view
|

Re: Page cache

satish
Dear erman,

Looks like you missed this post.Could you please update

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Page cache

ErmanArslansOracleBlog
Administrator
1) Yes. Oracle is not aware of the OS page cache anyways..

2)Oracle doesn't manage the OS cache. It is not aware of it.
So if Oracle can't find the needed data in its buffer cache, it does I/O..
When it comes to I/O, Oracle is dependent on the OS.
OS may get that data from its cache, or disk.. It doesn't matter for Oracle.

3)The term OS cache is not a good one actually.

 In Linux kernels with version < 2.2, we have both a Page Cache and a Buffer Cache. In Linux kernels with version > 2.4 , these two caches have been combined. After kernel version 2.4, there is only one cache, the Page Cache.

As I already mentioned ->

Page Cache is the cache in Os.
It holds file related data to accelerate the accesses to files on non-volatile storages.
Page Cache also holds unused areas of memory.
You can think Page Cache as the Buffer cache of the OS.
Page Cache is in memory.