在oracle database system其进程主要分为两大类
1.user process that run the application or oracle tool code
2.oracle database processes thar run the oracle database server code,其包含如下两类
1).server processes
2).backupground processes其包含如下进程
Database writer process (DBWn)
Log writer process (LGWR)
Checkpoint process (CKPT)
System Monitor process (SMON)
Process monitor process (PMON)
Recoverer process (RECO)
Job queue processes
Archiver processes (ARCn)
Queue monitor processes (QMNn)
这里user process很清楚明了,那么server processes是干嘛的?
Server processes created on behalf of each user’s application can perform one or more of the
following:
1.Parse and run SQL statements issued through the application
2.Read necessary data blocks from data files on disk into the shared database buffers of the SGA(if the blocks are not already present in the SGA)
3.Return results in such a way that the application can process the information
Oracle Database creates server processes to handle the requests of user processes connected to theinstance.
In some situations, when the application and Oracle Database operate on the same computer,
it is possible to combine the user process and corresponding server process into a single process toreduce system overhead.
However, when the application and Oracle Database operate on differentcomputers, a user process always communicates with Oracle Database through a separate server process.
DBWR在如下条件下触发写:
1.When a server process cannot find a clean reusable buffer after scanning a threshold number of buffers, it signals DBWn to write.
DBWn writes dirty buffers to disk asynchronously while performing other processing.
2.DBWn periodically writes buffers to advance the checkpoint, which is the position in the redo thread (log) from which instance recovery begins.
This log position is determined by the oldest dirty buffer in the buffer cache
LGWR在如下条件下触发写:
1.When a user pLogWriter process commits a transaction
2.When the redo log buffer is one-third full
3.Before a DBWn process writes modified buffers to disk (if necessary)
CKPT的信息记录在control file 和 data file header
SMON的作用:
performs recovery at instance startup
cleans up unused temporary segments
PMON作用:
1.performs proces recovery when a user porcess fails:
cleans up the database buffer cache
frees resources that are used by the user process
2.monitors sessions for idle session timeout
3.dynamlically registers database services with listeners