I have one serious doubt abt checkpointing and aging out of buffers from buffer cache for a very long time. Oracle books always say it is on LRU basis but it doesnt seem so to me.
This is what Oracle book says:
During the normal running of the database, buffers that get modified (dirty buffers) are added to end of the checkpoint queue. The checkpoint queue is a linked list of all dirty buffers, ordered by when they were first modified; therefore a dirty buffer is only listed once in the checkpoint queue. The first entry in the checkpoint queue is always the buffer that has been dirty for the longest time. Buffers are removed from the checkpoint queue after DBWn writes them to disk.
Each record in the redo log is assigned a redo byte address (RBA). When a block is first modified it is entered in the checkpoint queue. The RBA of the redo record recording that change is also included. All buffers that were modified prior to the first buffer in the checkpoint queue will already have been written to the data files.
Every three seconds the CKPT process records, in the control file, the RBA from the first entry in the checkpoint queue. In the event of instance failure this RBA will give the location in the redo logs at which to start recovery. This RBA is referred to as the checkpoint position. At a log switch the database will, in addition, update the checkpoint information in the header block of each data file. This log switch does not force a write of any data to the data files.
This always suggests to me that the buffers are aged out on First In First Out basis. Isn't it?
The checkpoint queue is a linked list of all dirty buffers, ordered by when they were first modified; therefore a dirty buffer is only listed once in the checkpoint queue. The first entry in the checkpoint queue is always the buffer that has been dirty for the longest time.
In this way, the buffer that get dirtied first will be the first one that will be aged out. N if this buffer is again modified, then irrespective of this fact, this buffer's position is not changed on checkpointing queue as a dirty buffer is listed only once in the checkpointing queue.
This is wat Oracle's book content suggests to me..What do u think? How do u perceive it?
Last edited by mahajanakhil198; 04-16-2009 at 04:04 AM.