What is lru in oracle




















Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise.

All legitimate Oracle experts publish their Oracle qualifications. Oracle technology is changing and we strive to update our BC Oracle support information. If you find an error or have a suggestion for improving our content, we would appreciate your feedback. Just e-mail: and include the URL for the page. All rights reserved by Burleson. Oracle internal latches Latches are in-memory locks that ensure one-at-a-time, serial access for when an Oracle process modifies a RAM structure.

Note: Protecting Oracle's competitive advantage All database vendors have a vested interest in protecting their competitive advantage, especially within the software kernel, and much of Oracle's competitive advantage lies in their superb code. In order to ensure that frequently-referenced data blocks remain in the buffers, Oracle probably uses this sequence of events for initial reads physical reads and logical buffer reads consistent gets : Physical reads: When Oracle does a disk read, the database must buffer-up the data block and adjust the RAM pointers: 1 - Oracle marks the LRU address as eligible for over-writing and Oracle perform a disk read and load the data block into this RAM slot, the buffer marked as LRU least recently used.

During this operation the database needs to ensure that the process managing the read has exclusive control of the buffer address list: Oracle's data buffer causes blocks to stay cached based on popularity Logical buffer reads: When a request is made for a data block that is already in the data buffer, it is 'promoted' to the head of the data buffer address list, thereby helping to ensure caching of frequently-referenced blocks: 1 - Oracle issues an 'LRU latch' to ensure that the process has exclusive control over the address list.

Latch and buffer contention Oracle records a 'latch miss' when a process must wait for a latch to become available, and we also see 'buffer busy waits' when a process must wait for a freelist.

Top 5 Timed Events. Event Waits Time s Ela Time. CPU time This buffer between the requests of the users and the actual datafiles improves the performance of the Oracle database. If a piece of data can be found in the buffer cache for example, as the result of a recent query , you can retrieve it from memory without the overhead of having to go to disk.

Oracle manages the cache using a least recently used LRU algorithm. If a user requests data that has been recently used, the data is more likely to be in the database buffer cache; data in the cache can be delivered immediately without a disk-read operation being executed. When a user wants to read a block that is not in the cache, the block must be read and loaded into the cache. When a user makes changes to a block, those changes are made to the block in the cache.

At some later time, those changes will be written to the datafile in which the block resides. I prefer to describe it like that as most people are familiar with the concept of LRU In short, when you hear LRU, think of a cache that manages some data any data , and tends to discard items from the cache based on whether they have been used recently or not.

The more recently something has been used - the more likely it is to stay in the cache. This uniquely identifies a block in a database. We use that as the "key" to the block in the buffer cache. The buffer cache can be thought of as being like a two dimensional array. There is an array of lists - the lists are blocks that are in the cache. In order to locate a block in the cache - we will take the DBA of the block and hash that to figure out what array would contain that block if it is in the cache at all.

So, we get that hash which will be a number between 0 and N-1 where N is the size of the array of lists. We would then use a cache buffers chains latch to secure access to that array element a root pointer to a list of blocks.

Once we have that latch - we can search that list for the block. When it is filled up - and has a block with a DBA assigned to it - it would be unlinked from the free list which wouldn't need to be an LRU of course, it would just be a list and linked into one of the lists in the array of lists based on the hash of its DBA.

You can also catch regular content via Connor's blog and Chris's blog. Or if video is more your thing, check out Connor's latest video and Chris's latest video from their Youtube channels.



0コメント

  • 1000 / 1000