本章提要
----------------------------------------------
所有的 process 都是在 PGA 内(memory)
server process: 与 client 连接有关(在PGA中)
bakground process: 作维护工作(在PGA中)
slave process: 很像background process, 但是他们做额外的工作帮助server process或background process(在PGA中)
----------------------------------------------
1. server process
它是 client session 的一个代理, They are the processes that ultimately receive and act on the SQL
statements our applications send to the database.
Both dedicated and shared server processes have the same job: they process all of the SQL you give
to them.( 都是要做将client提交的sql语句解析, 并将它放到shared pool中 等 )这个进程负荷很高,占用CPU也
很多.
connection VS session: 一个connection只是一个物理的连接(client 进程 与 server 端的某个进程), 网络连接
在一个connection 上可以有0~N个独立的session, 另外, 借助于其他媒介, session也可以没有connection,比如
connection pooling 连接池, A session is a logical entity that exists in the instance, It is your
session state, or a collection of data structures in memory that represents your unique session.
查询的结果集会返回给你这个session,
AUTOTRACE: When we enable AUTOTRACE in SQL*Plus, SQL*Plus will perform the following actions when we
execute DML operations (INSERT, UPDATE, DELETE, SELECT, and MERGE):
1) It will create a new session using the current connection, if the secondary session does not
already exist.
2) It will ask this new session to query the V$SESSTAT view to remember the initial statistics values
for the session in which we will run the DML.
3) It will run the DML operation in the original session. (执行dml在之前的session)
4) Upon completion of that DML statement, SQL*Plus will request the other session to query V$SESSTAT again
and produce the report displayed previously showing the difference in the statistics for the session
that executed the DML.
2. background process
instance 是由 SGA 和 background process 组成.
picture: 5-4
中心进程介绍:
1) pmon, 负责在出现异常中断连接之后完成清理. 另外, 它还向 oracle tns 监听器注册这个实例(动态注册)
2) smon, 完成系统级任务, 清理临时空间, 合并空闲空间 等
3) reco, 分布式数据库恢复
4) ckpt, 检查点进程
5) dbwn, 数据库写入器
6) lgrw, 日志写入器
7) arch, 归档进程
8) diag, 诊断进程
9) fbda, 闪回数据归档进程
10) dbrm, 数据库资源管理进程
11) gen0, 通用任务进程