Craig Shallahamer's Blog
|
You were brought to this page based on an internet search
and as a free service to Oracle DBAs.
The text below is an except from the book,
Oracle Performance Firefighting, written by
Craig Shallahamer of
OraPub, Inc.
Figures and tables are not included on this page, only their reference.
To order the book in either print or PDF form, click
here.
©2009, 2010 by Craig Shallahamer. This is copyrighted material.
PleaseOut of respect for those involved in the creation of the book and also for
their familes, we ask you to respect the copyright both in intent and deed. Thank you.
-------------------------------
<p>You'll need a free buffer to insert the just-read block into the buffer cache, so you go to the LRU end of the LRU chain you're associated with. But before you can start scanning the LRU chain, you must contend for and acquire the associated LRU chain latch. After consuming CPU by spinning and posting the wait event latch: cache buffers lru chains while sleeping, you finally acquire the latch. Starting at the LRU end of your LRU chain, you ask the buffer header (this would be buffer header BH 310 in Figure 6-18) if it is an unpopular free buffer, and it replies that unfortunately, it is not all that popular. You now begin the unpopular buffer replacement process. You immediately pin the buffer header. From the buffer header, you get the memory address of the block buffer in the buffer cache, replace the buffer with the just-read block you're still holding in your PGA memory, make any required buffer header modifications. You manipulate the LRU chain to move the buffer header to the LRU chain's midpoint, release the LRU chain latch, and unpin the buffer header. Now any server or background process, including you, can access the buffer-and all in a moment's work.
p><p>The concept is that every time a buffer header gets touched, its touch count is incremented. In reality, this is not true. Consider the situation shown in Figure 6-19. The long horizontal axis represents time, and the tick marks occur every 3 seconds. The arrows are when the buffer header is touched.
p><p>Figure 6-19. By default, a buffer header's touch count can be incremented only once every 3 seconds. This helps ensure a buffer deemed popular is active more than just a few seconds.
p>
©2009, 2010 by Craig Shallahamer. This is copyrighted material.
PleaseOut of respect for those involved in the creation of the book and also for
their familes, we ask you to respect the copyright both in intent and deed. Thank you.
|
|
Know what's important before it's too late!
OraPub's Performance Training is like no other...
More Class Pics...
Get student testimonials!
|