Information Technology Reference
In-Depth Information
When an instance of the database system is running, the following volatile data
structures are maintained in the virtual memory shared by the server processes:
3. Buffer pool or database buffer for the buffering of database pages read from disk.
4. Log buffer for the buffering of the log file.
5. Active-transaction table for storing information about active transactions.
6. Modified-page table for storing information about buffered pages.
7. Lock table for storing the locks held by active transactions (when transactional
concurrency control is based on locking).
8. Other volatile structures, such as a query-plan cache for storing (for reuse)
compiled query execution plans.
The data disks and the database buffer are based on random access on database
pages (via page identifiers), whereas the log disks and the log buffer are append-
only sequential files. Each database update is performed on a page copied from the
data disk into the database buffer, and the update is logged with a log record that is
appended into the log buffer. The log record holds information that makes it possible
to redo the update on an old version of the page (in the case when the update is lost
due to a failure) and undo the update (at transaction rollback).
At transaction commit or when the log buffer is full, the contents of the log
buffer are flushed onto the log disk, where the log records are appended next to the
previously flushed log records. Thus every committed transaction has all its updates
recorded permanently at least on the log disk.
The most important source of efficiency of transaction processing in a log-based
system is that the random-access database residing on the data disks need not imme-
diately reflect the updates of transactions: updated pages from the database buffer
need not be flushed at transaction commit. For correctness of operation, an updated
data page must not be flushed before flushing first the log records for the update.
In a database-system instance, several database processes operate on the shared
database on disk and on the shared virtual-memory data structures:
1. Server processes and their threads (already mentioned above) that service
requests from application processes and generate transactions
2. Database-writer process that flushes updated database pages from the buffer onto
disk
3. Log-writer process that flushes log records from the log buffer onto the log disk
when the log buffer becomes full or when a server process requests, at transaction
commit, the log to be flushed onto disk
4. Checkpoint process that periodically takes a checkpoint in which certain volatile
data is written onto disk
5. Process-monitor process that monitors other processes of the system and takes
care of recovery of failed processes, including aborting and rolling back transac-
tions that have terminated because of a failure of a server process
6. Lock-manager process that services requests to acquire or release locks on data
items and takes care of detecting deadlocks
Search WWH ::




Custom Search