Checkpoint
and LRU
* Every
buffer in the db buffer cache will be in one of three states: pinned, dirty or
free.
o A
pinned buffer is a buffer that is in use.
o A
dirty buffer is one that has not yet been flushed to disk.
o A
free or clean buffer is when the block has been copied into the cache and not
yet changed or it has been changed and already flushed to disk.
*
There should be many free buffers in the cache at any time. The decision on
which buffer to use will be determined by the LRU List. The oldest accessed
block will be overwritten.
*
Another list is the Checkpoint Queue. This is a list of dirty buffers waiting
to be written to disk by DBWn.
* The
process that searches for free buffers in the LRU List also notifies the
Checkpoint Queue of dirty buffers and adds them to the list. The LRU blocks
will be written to disk first.
* When
data gets written to disk:
o A
server process takes too long to find a free buffer.
o The
checkpoint queue is too long.
o
Every 3 seconds, DBWn writes dirty buffers to disk.
* The
only time that all dirty buffers get written to disk is when a checkpoint
occurs (ex. SHUTDOWN, or alter system checkpoint).
*
Tablespace checkpoints occur:
o
tablespace is dropped
o
tablespace made read-only
o
tablespace put into hot backup mode
o
tablespace is taken offline
* Log
switches do not trigger a checkpoint.
No comments:
Post a Comment