一:进程简介
- 应用程序或者Oracle数据库实用程序
- Oracle数据库代码
1:多进程Oracle 数据库代码
2:进程类型
实例恢复:SMON
清理进程:PMON
重做缓冲区写入磁盘:dbwn
---查看数据库状态SYS@orcl> status v$instance;STATUS---------------从上得知:此时数据库是打开open状态:查看此时数据库的后台进程信息SYS@orcl> ho ps -ef |grep ora_oracle 11999 1 0 May09 ? 00:00:05 ora_pmon_orcloracle 12001 1 0 May09 ? 00:00:18 ora_psp0_orcloracle 12003 1 0 May09 ? 00:00:29 ora_vktm_orcloracle 12007 1 0 May09 ? 00:00:01 ora_gen0_orcloracle 12009 1 0 May09 ? 00:00:01 ora_diag_orcloracle 12011 1 0 May09 ? 00:00:02 ora_dbrm_orcloracle 12013 1 0 May09 ? 00:00:10 ora_dia0_orcloracle 12015 1 0 May09 ? 00:00:01 ora_mman_orcloracle 12017 1 0 May09 ? 00:00:19 ora_dbw0_orcloracle 12019 1 0 May09 ? 00:00:28 ora_lgwr_orcloracle 12021 1 0 May09 ? 00:00:26 ora_ckpt_orcloracle 12023 1 0 May09 ? 00:01:10 ora_smon_orcloracle 12025 1 0 May09 ? 00:00:01 ora_reco_orcloracle 12027 1 0 May09 ? 00:00:20 ora_mmon_orcloracle 12029 1 0 May09 ? 00:01:48 ora_mmnl_orcloracle 12031 1 0 May09 ? 00:00:01 ora_d000_orcloracle 12033 1 0 May09 ? 00:00:02 ora_s000_orcloracle 12062 1 0 May09 ? 00:00:09 ora_arc0_orcloracle 12064 1 0 May09 ? 00:00:10 ora_arc1_orcloracle 12066 1 0 May09 ? 00:00:01 ora_arc2_orcloracle 12070 1 0 May09 ? 00:00:14 ora_arc3_orcloracle 12072 1 0 May09 ? 00:00:01 ora_qmnc_orcloracle 12088 1 0 May09 ? 00:00:17 ora_cjq0_orcloracle 12092 1 0 May09 ? 00:00:01 ora_q000_orcloracle 12126 1 0 May09 ? 00:00:01 ora_smco_orcloracle 25238 1 0 15:56 ? 00:00:00 ora_q002_orcloracle 28073 1 0 22:00 ? 00:00:00 ora_vkrm_orcloracle 28839 1 0 23:41 ? 00:00:00 ora_w000_orcloracle 28853 28836 0 23:42 pts/2 00:00:00 /bin/bash -c ps -ef |grep ora_oracle 28855 28853 0 23:42 pts/2 00:00:00 grep ora_SYS@orcl>---删除后台进程 smon ;SYS@orcl> ho -9 12023/bin/bash: line 0: : (12023) - such process---再来查看数据库状态SYS@orcl> status v$instance; status v$instance*ERROR line 1:ORA-03135: lost contactProcess ID: 28837 ID: 200 Serial number: 4305---从查询结果来看:数据库的o'r'c'l实例已经不存在了,所以其数据库状态 也就不存在;SYS@orcl>---此时:oracle的所有后台进程全部终止SYS@orcl> ho ps -ef |grep ora_oracle 28885 28836 0 23:48 pts/2 00:00:00 /bin/bash -c ps -ef |grep ora_oracle 28887 28885 0 23:48 pts/2 00:00:00 grep ora_SYS@orcl>SYS@orcl> Disconnected Oracle 11g Enterprise Edition Release 11.2.0.3.0 - Production the Partitioning, OLAP, Data Mining Application Testing options[oracle@localhost ~]$ sqlplus / sysdba;*Plus: Release 11.2.0.3.0 Production Mon May 14 23:49:37 2018Copyright (c) 1982, 2011, Oracle. rights reserved.Connected an idle instance.---退出再登陆后;发现此时是空闲实例SYS@orcl>----当数据库实例不能运行或者阻塞状态时,可以直接 kill -9 smon后台进程;然后再重新启动数据库:SYS@orcl> Disconnected Oracle 11g Enterprise Edition Release 11.2.0.3.0 - Production the Partitioning, OLAP, Data Mining Application Testing options[oracle@localhost ~]$ rlwrap sqlplus / sysdba;*Plus: Release 11.2.0.3.0 Production Mon May 14 23:49:37 2018Copyright (c) 1982, 2011, Oracle. rights reserved.Connected an idle instance.SYS@orcl> startupORACLE instance started.Total System Area 523108352 bytesFixed 1346052 bytesVariable 394266108 bytes Buffers 121634816 bytesRedo Buffers 5861376 bytes mounted. opened.SYS@orcl> ho ps -ef |grep ora_oracle 28970 1 0 23:53 ? 00:00:00 ora_pmon_orcloracle 28972 1 0 23:53 ? 00:00:00 ora_psp0_orcloracle 28974 1 0 23:53 ? 00:00:00 ora_vktm_orcloracle 28978 1 0 23:53 ? 00:00:00 ora_gen0_orcloracle 28980 1 0 23:53 ? 00:00:00 ora_diag_orcloracle 28982 1 0 23:53 ? 00:00:00 ora_dbrm_orcloracle 28984 1 0 23:53 ? 00:00:00 ora_dia0_orcloracle 28986 1 3 23:53 ? 00:00:00 ora_mman_orcloracle 28988 1 0 23:53 ? 00:00:00 ora_dbw0_orcloracle 28990 1 0 23:53 ? 00:00:00 ora_lgwr_orcloracle 28992 1 0 23:53 ? 00:00:00 ora_ckpt_orcloracle 28994 1 0 23:53 ? 00:00:00 ora_smon_orcloracle 28996 1 0 23:53 ? 00:00:00 ora_reco_orcloracle 28998 1 2 23:53 ? 00:00:00 ora_mmon_orcloracle 29000 1 0 23:53 ? 00:00:00 ora_mmnl_orcloracle 29002 1 0 23:53 ? 00:00:00 ora_d000_orcloracle 29004 1 0 23:53 ? 00:00:00 ora_s000_orcloracle 29033 1 0 23:53 ? 00:00:00 ora_p000_orcloracle 29035 1 0 23:53 ? 00:00:00 ora_p001_orcloracle 29037 1 0 23:53 ? 00:00:00 ora_p002_orcloracle 29039 1 0 23:53 ? 00:00:00 ora_arc0_orcloracle 29041 1 9 23:53 ? 00:00:00 ora_arc1_orcloracle 29043 1 12 23:53 ? 00:00:01 ora_arc2_orcloracle 29045 1 9 23:53 ? 00:00:00 ora_arc3_orcloracle 29051 1 0 23:53 ? 00:00:00 ora_qmnc_orcloracle 29067 1 2 23:53 ? 00:00:00 ora_cjq0_orcloracle 29069 1 0 23:54 ? 00:00:00 ora_vkrm_orcloracle 29071 1 16 23:54 ? 00:00:00 ora_j000_orcloracle 29073 1 3 23:54 ? 00:00:00 ora_j001_orcloracle 29075 1 4 23:54 ? 00:00:00 ora_j002_orcloracle 29077 1 0 23:54 ? 00:00:00 ora_j003_orcloracle 29078 28891 0 23:54 pts/2 00:00:00 /bin/bash -c ps -ef |grep ora_oracle 29080 29078 0 23:54 pts/2 00:00:00 grep ora_SYS@orcl>
二:客户端 进程描述
1:客户端和服务器进程
oracle 进程必须是在 oracle服务器上产生
2:连接和会话
三:服务器进程概述
1:专用服务器进程
2:共享服务器进程
四:后台进程概述
查看后台进程
SYS@orcl> linesize 3000;SYS@orcl> pname pname pname;PNAME-----ARC0ARC1ARC2ARC3CJQ0CKPTD000DBRMDBW0DIA0DIAGPNAME-----GEN0J000J001LGWRMMANMMNLMMONPMONPSP0Q000Q001PNAME-----QMNCRECOS000SMCOSMONVKTMW00029 selected.SYS@orcl>SYS@orcl> oracle 3497 1 0 09:49 ? 00:00:00 ora_w000_orcloracle 3635 1 0 10:00 ? 00:00:00 ora_j000_orcloracle 3637 1 0 10:00 ? 00:00:00 ora_j001_orcloracle 3638 28891 0 10:01 pts/2 00:00:00 /bin/bash -c ps -ef |grep ora_oracle 3640 3638 0 10:01 pts/2 00:00:00 grep ora_oracle 28970 1 0 May14 ? 00:00:00 ora_pmon_orcloracle 28972 1 0 May14 ? 00:00:01 ora_psp0_orcloracle 28974 1 0 May14 ? 00:00:01 ora_vktm_orcloracle 28978 1 0 May14 ? 00:00:00 ora_gen0_orcloracle 28980 1 0 May14 ? 00:00:00 ora_diag_orcloracle 28982 1 0 May14 ? 00:00:00 ora_dbrm_orcloracle 28984 1 0 May14 ? 00:00:00 ora_dia0_orcloracle 28986 1 0 May14 ? 00:00:00 ora_mman_orcloracle 28988 1 0 May14 ? 00:00:01 ora_dbw0_orcloracle 28990 1 0 May14 ? 00:00:01 ora_lgwr_orcloracle 28992 1 0 May14 ? 00:00:02 ora_ckpt_orcloracle 28994 1 0 May14 ? 00:00:00 ora_smon_orcloracle 28996 1 0 May14 ? 00:00:00 ora_reco_orcloracle 28998 1 0 May14 ? 00:00:01 ora_mmon_orcloracle 29000 1 0 May14 ? 00:00:03 ora_mmnl_orcloracle 29002 1 0 May14 ? 00:00:00 ora_d000_orcloracle 29004 1 0 May14 ? 00:00:00 ora_s000_orcloracle 29039 1 0 May14 ? 00:00:00 ora_arc0_orcloracle 29041 1 9 May14 ? 00:55:49 ora_arc1_orcloracle 29043 1 9 May14 ? 00:55:37 ora_arc2_orcloracle 29045 1 9 May14 ? 00:55:33 ora_arc3_orcloracle 29051 1 0 May14 ? 00:00:00 ora_qmnc_orcloracle 29067 1 0 May14 ? 00:00:00 ora_cjq0_orcloracle 29082 1 0 May14 ? 00:00:00 ora_q000_orcloracle 29084 1 0 May14 ? 00:00:00 ora_q001_orcloracle 29130 1 0 May14 ? 00:00:00 ora_smco_orclSYS@orcl>
1:强制性后台进程
进程监视器进程 PMON
即:如果 PMOM进程出现问题,则数据库的网络连接可能链接不了
系统监视器进程 SMON
表空间:居多使用的都是本地管理方式
数据库写入器进程DBwn
DBWn: n 表示 数字:从0 开始 1,2,3,4,5……….
增量检查点
日志写入器进程 LGWR
commit ;命令执行的操作:此时只是把缓冲区的数据写入到练级重做日志文件。此时数据还未写入到数据文件。
3秒钟 开始执行
先执行 LGWR 然后再执行 DBwn 。即:当缓冲区的脏数据写入到练级重做日志文件后,才开始将数据缓冲区的数据写入到数据库文件中。
LGWR与提交
当 ckpt开始工作的时候, 调用 DBWn开始工作,把缓冲区的数据写入到数据文件中,并从日志文件中获取SCN号来更新控制文件和数据文件头部的SCN号。
恢复器进程 RECO
2:可选后台进程
归档器进程ARCn
作业队列进程 CJQ0 Jnnn
闪回数据存档器进程 FBDA
3:从属进程
——————————————————————————————————————————————————————