Entradas

Mostrando entradas de octubre, 2008

Trabajo con Latches

What Are Latches? Latches are serialization mechanisms that protect areas of Oracle’s shared memory (the SGA). In simple terms, latches prevent two processes from simultaneously updating — and possibly corrupting — the same area of the SGA. Oracle sessions need to update or read from the SGA for almost all database operations. For instance: • When a session reads a block from disk, it must modify a free block in the buffer cache and adjust the buffer cache LRU chain1. • When a session reads a block from the SGA, it will modify the LRU chain. • When a new SQL statement is parsed, it will be added to the library cache within the SGA. • As modifications are made to blocks, entries are placed in the redo buffer. • The database writer periodically writes buffers from the cache to disk (and must update their status from “dirty” to “clean”). • The redo log writer writes entries from the redo buffer to the redo logs. Latches prevent any of these operations from colliding and possibly corruptin...