01.09.2016 Views

Beginning Oracle Database 11g Administration From Novice to Professional

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

58<br />

CHAPTER 3 ORACLE ARCHITECTURE<br />

The foreground process performs activities such as checking whether the user has<br />

permission <strong>to</strong> access the data, generating a query execution plan for the SQL query submitted<br />

by the user, and retrieving data blocks in<strong>to</strong> the buffer cache and modifying them.<br />

Before changing the contents of block buffers, it gains exclusive control <strong>to</strong> them by using<br />

a latch (as noted earlier, this is an inter-process communication, or IPC, mechanism).<br />

Before modifying a data block, the foreground process first makes a copy of the block in<br />

an undo segment in the undo tablespace; it also creates the undo and redo entries that<br />

the log writer will s<strong>to</strong>re in the redo log files.<br />

A dedicated foreground process is terminated when the corresponding database session<br />

is terminated.<br />

Background Processes<br />

Unlike dedicated foreground processes, background processes live from database startup<br />

until database shutdown. The following are some of the better-known categories of background<br />

processes:<br />

database writer (DBWR) process is responsible for transferring all modified<br />

data blocks in the data caches <strong>to</strong> the data files. Multiple database writer processes<br />

can be created if necessary <strong>to</strong> share the load.<br />

log writer (LGWR) process is responsible for transferring all undo and redo<br />

entries in the log buffer <strong>to</strong> the redo log files.<br />

archiver (ARCH) process is responsible for making copies of the redo log files<br />

when they fill up. These archived redo log files will be required if a data file is damaged<br />

and needs repair. Multiple archiver processes can be created if necessary <strong>to</strong><br />

share the load.<br />

diately<br />

transferred <strong>to</strong> the data files. In the interest of efficiency, it is better <strong>to</strong> copy<br />

changes in batches—this is the function of the database writer processes. However,<br />

at frequent intervals, the contents of the data caches are synchronized with<br />

the data files. Any modified data blocks remaining in memory are flushed <strong>to</strong> disk,<br />

and the file headers are updated with a special indica<strong>to</strong>r called the system change<br />

number (SCN). This activity is called a checkpoint, and the task of coordinating this<br />

activity is performed by a dedicated process called the checkpoint process (CKPT).<br />

process moni<strong>to</strong>r (PMON) watches the progress of database connections. If a<br />

connection terminates abnormally, the process moni<strong>to</strong>r initiates the necessary<br />

rollback activity on behalf of any transaction that was in progress at the time.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!