Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Oracle what does 'Buffer Gets' actually refer to?

Tags:

sql

oracle

I'm dealing with an Oracle DBA at the moment, who has sent me some profiling he's done. One of the terms in his report is 'Buffer Gets', any idea what this actually means? My guess is bytes retrieved from a buffer, but I have no idea really. Here is some sample output:

  Buffer Gets    Executions  Gets per Exec  %Total Time (s)  Time (s) Hash Value --------------- ------------ -------------- ------ -------- --------- ----------     137,948,100       31,495        4,380.0   98.4  6980.57   6873.46 4212400674 Module: JDBC Thin Client SELECT fieldOne, fieldTwo, fieldThree, fieldFour, fieldFive FROM TableExample WHERE fieldOne = 'example' 

It would also be handy to know what 'Gets per Exec' means, as I guess they are related? I'm a programmer, but not a DBA.

like image 998
rustyshelf Avatar asked Nov 17 '08 06:11

rustyshelf


People also ask

What is a buffer get in Oracle?

Buffer gets is a metric of CPU usage and means the number of buffer gets for the all cursors. When Oracle needs access to a data block, first it checks to see if the data block is already availabe in the database buffer, If so Oracle issues a "logical read" and fetches the data block directly from RAM.

What is gets in AWR report?

The Buffer Gets Oracle metric is the number of buffer gets for all cursors. A measurement of CPU usage, excessive buffer gets may indicate that this statement needs to be examined more closely. statements called by the code.

What is buffer Size in Oracle?

The default buffer size is 20000 bytes. The minimum size is 2000 bytes and the maximum is unlimited.

What is the purpose of the Oracle DB buffer cache?

About the Database Buffer Cache For many types of operations, Oracle Database uses the buffer cache to store data blocks read from disk. Oracle Database bypasses the buffer cache for particular operations, such as sorting and parallel reads.


1 Answers

Oracle storage is arranged into blocks of a given size (e.g. 8k). Tables and indexes are made up of a series of blocks on the disk. When these blocks are in memory they occupy a buffer.

When Oracle requires a block it does a buffer get. First it checks to see if it already has the block it needs in memory. If so, the in-memory version is used. If it does not have the block in memory then it will read it from disk into memory.

So a buffer get represents the number of times Oracle had to access a block. The reads could have been satisfied either from memory (the buffers) or have resulted in a physical IO.

Since physical IO is so expensive (compared to memory or CPU) one approach to tuning is to concentrate on reduction in buffer gets which is assumed will flow on to reduce physical IO.

like image 183
WW. Avatar answered Sep 21 '22 15:09

WW.