Databases Reference
In-Depth Information
Database Client
System Global Area
S
H
A
D
O
W
Buffer Cache
Shared Pool
Log Buffer
Java Pool
Streams Pool
Large Pool
T
H
R
E
A
D
PMON
SMON
BDWn
LGWR
PSPn
ARCn
Control Files
Online Redo
Log Files
Archived Redo
Log Files
Datafiles
Figure 21-1. Oracle Database instance architecture on Windows
The buffer cache is a memory area to hold the blocks of the table data retrieved from the database data files.
When the user requests a piece of data from a table, the Oracle database gets it from the disk and places it in the buffer
cache. The data is then served from the buffer cache to the user. If another user requests the same data, the database
gets it from the buffer cache instead of from the disk again.
When the user sessions make changes to the database, the pre-change and post-change images of the data are
written to a memory area called the log buffer . When the user commits, the contents of the log buffer are written to the
disk to special files called online redo log files . If the instance crashes, all the memory areas disappear. By examining
the online redo log files, the database can find out which operations have been successful and which ones need to be
discarded. The log buffer contents are flushed to the online redo log files by a process known as the log writer (LGWR).
The flushing occurs when any one of the following happens:
The log buffer is one-third full.
It has been three seconds since the last flush.
The log buffer is 1MB full.
A session commits.
The checkpoint occurs.
When a user changes the data, the change occurs in the buffer cache only, not on the disk. This way, the slowest
operation—the physical I/O to the disk—does not become the bottleneck as the database changes. The changed
blocks in the buffer cache—known as dirty blocks—are written to the data files by a process known as the data buffer
writer (DBWn). There can be more than one DBWn process; hence, they are named DBW0, DBW1, and so on. On
Windows, however, there is no need to define multiple DBWn processes, because the I/O is asynchronous anyway and
one database writer is enough. The event of flushing data from the cache to the data files is called checkpointing.
 
 
Search WWH ::




Custom Search