Dion Cho – Oracle Performance Storyteller

We are natural born scientists

Posts Tagged ‘serial direct path read

Serial Direct Path Read and Block Cleanout(11g)

with 2 comments

Chris Antognini posted an article about the serial direct path read and repeated block cleanout problem here. I’d just like to add my own interpretation on this phenomenon.

In summary,

  1. Oracle needs to cleanout the dirty blocks to determine the status of the block and rolls them back if necessary.
  2. But it does not mean that Oracle modifies the dirty blocks. It just checks the status of the dirty blocks.
  3. So, it does not generate redo and does not physically cleanout the dirty blocks.

Following is the the result of block dump which helps you to understand exactly when Oracle physically modifies the dirty block.

-- before update
 Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x0007.00a.000036ed  0x00c0032b.1929.08  C---    0  scn 0x07df.2427c615
0x02   0x0000.000.00000000  0x00000000.0000.00  ----    0  fsc 0x0000.00000000

-- after update
 Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x0007.00a.000036ed  0x00c0032b.1929.08  C---    0  scn 0x07df.2427c615
0x02   0x0006.001.0000480a  0x00c010b1.17f3.02  ----    1  fsc 0x0000.00000000 (cleanout is delayed)

-- after direct path read
 Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x0007.00a.000036ed  0x00c0032b.1929.08  C---    0  scn 0x07df.2427c615
0x02   0x0006.001.0000480a  0x00c010b1.17f3.02  ----    1  fsc 0x0000.00000000 (wasn't cleaned out)

-- after conventional path read
 Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x0007.00a.000036ed  0x00c0032b.1929.08  C---    0  scn 0x07df.2427c615
0x02   0x0006.001.0000480a  0x00c010b1.17f3.02  C---    0  scn 0x07df.2427ffae (was cleaned out)

Statistics shows another insight.
(block count# is 6010 in my test case)

-- after direct path read
consistent gets from cache                      6,025
consistent gets - examination                   6,011
immediate (CR) block cleanout applicatio        6,010
ns                                                   
cleanout - number of ktugct calls               6,010
cleanouts only - consistent read gets           6,010
commit txn count during cleanout                6,010
redo size                                       4,112

-- after conventional read
redo size                                     438,084
session logical reads                          12,103
consistent gets                                12,076
consistent gets from cache                     12,076
redo entries                                    6,025
consistent gets - examination                   6,016
cleanout - number of ktugct calls               6,016
cleanouts only - consistent read gets           6,010
immediate (CR) block cleanout applicatio        6,010
ns                                                   
commit txn count during cleanout                6,010
consistent gets from cache (fastpath)           5,668

We can tell that Oracle internally cleans out the dirty blocks from the statistics. But the serial direct path read does not load the current version of the block into the buffer cache. So it cannot modify the current block. It just reads the disk-version of the blocks from the data file and refers to the undo to cleanout the dirty blocks.

I think that it is unfair to call this a problem, but under certain situation it might cause problems like ORA-01555 error or repeated reads on the undo.

Footnote1:The traditional term of cleanout meant the modification on the dirty block to me, but I realized that I need more sophiscated terminology.

Footnote2: I believe that the parallel direct path read has the same design and feature with regard to the cleanout mechanism.

Written by Dion Cho

July 29, 2009 at 4:15 am

Posted in I/O, Misc.

Tagged with ,

Follow

Get every new post delivered to your Inbox.

Join 58 other followers