--Oracle进程与系统进程
--------------------------2013/11/25
这里讨论Linux/Unix环境下,oracle v$process与操作系统对应的关系。
系统端:
[Oracle@localhost ~]$ ps -ef |head -1 ;ps -ef |grep ora |sort -r +1n -2 | grep -v grep
UID PID PPID C STIME TTY TIME CMD
Oracle 1108 2606 0 Nov23 ? 00:00:01 [oracle] <defunct>
Oracle 1125 1 0 Nov23 ? 00:00:11 ora_q001_august
Oracle 1167 1 0 Nov23 ? 00:01:02 ora_cjq0_august
Oracle 2578 1 0 Nov20 ? 00:01:27 ora_pmon_august
Oracle 2580 1 0 Nov20 ? 00:13:38 ora_vktm_august
Oracle 2584 1 0 Nov20 ? 00:00:11 ora_gen0_august
Oracle 2586 1 0 Nov20 ? 00:00:20 ora_diag_august
Oracle 2588 1 0 Nov20 ? 00:00:34 ora_dbrm_august
Oracle 2590 1 0 Nov20 ? 00:00:51 ora_psp0_august
Oracle 2592 1 0 Nov20 ? 00:01:37 ora_dia0_august
Oracle 2594 1 0 Nov20 ? 00:02:23 ora_mman_august
Oracle 2596 1 0 Nov20 ? 00:02:55 ora_dbw0_august
Oracle 2598 1 0 Nov20 ? 00:06:08 ora_lgwr_august
Oracle 2600 1 0 Nov20 ? 00:04:30 ora_ckpt_august
Oracle 2602 1 0 Nov20 ? 00:07:14 ora_smon_august
Oracle 2604 1 0 Nov20 ? 00:00:24 ora_reco_august
Oracle 2606 1 0 Nov20 ? 00:03:13 ora_mmon_august
Oracle 2608 1 0 Nov20 ? 00:01:52 ora_mmnl_august
Oracle 2610 1 0 Nov20 ? 00:00:17 ora_d000_august
Oracle 2612 1 0 Nov20 ? 00:00:22 ora_s000_august
Oracle 2637 1 0 Nov20 ? 00:05:12 ora_arc0_august
Oracle 2639 1 0 Nov20 ? 00:01:49 ora_arc1_august
Oracle 2641 1 0 Nov20 ? 00:00:42 ora_arc2_august
Oracle 2643 1 0 Nov20 ? 00:02:05 ora_arc3_august
Oracle 2645 1 0 Nov20 ? 00:00:19 ora_nsa2_august
Oracle 2649 1 0 Nov20 ? 00:00:25 ora_qmnc_august
Oracle 2800 1 0 Nov20 ? 00:00:25 ora_smco_august
Oracle 24302 1 0 05:20 ? 00:00:00 ora_q003_august
Oracle 24637 24635 0 05:35 ? 00:00:03 oracleaugust (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) *用户进程
Oracle 25010 1 0 06:00 ? 00:00:01 ora_w000_august
*如果想统计oracle进程在系统中的数量,可以这样: ps -ef | grep ora | wc -l (这里我的oracle用户名为Oracle,这样这条命令才可以过滤不相干的)
数据库端:
SQL> select spid,program from v$process order by spid;
SPID PROGRAM
---------- ----------------------------------------
1125 oracle@localhost.localdomain (Q001)
1167 oracle@localhost.localdomain (CJQ0)
24302 oracle@localhost.localdomain (Q003)
24637 oracle@localhost.localdomain (TNS V1-V3) *用户进程在v$process中
25010 oracle@localhost.localdomain (W000)
25335 oracle@localhost.localdomain (J000)
25337 oracle@localhost.localdomain (J001)
2578 oracle@localhost.localdomain (PMON)
2580 oracle@localhost.localdomain (VKTM)
2584 oracle@localhost.localdomain (GEN0)
2586 oracle@localhost.localdomain (DIAG)
SPID PROGRAM
---------- ----------------------------------------
2588 oracle@localhost.localdomain (DBRM)
2590 oracle@localhost.localdomain (PSP0)
2592 oracle@localhost.localdomain (DIA0)
2594 oracle@localhost.localdomain (MMAN)
2596 oracle@localhost.localdomain (DBW0)
2598 oracle@localhost.localdomain (LGWR)
2600 oracle@localhost.localdomain (CKPT)
2602 oracle@localhost.localdomain (SMON)
2604 oracle@localhost.localdomain (RECO)
2606 oracle@localhost.localdomain (MMON)
2608 oracle@localhost.localdomain (MMNL)
SPID PROGRAM
---------- ----------------------------------------
2610 oracle@localhost.localdomain (D000)
2612 oracle@localhost.localdomain (S000)
2637 oracle@localhost.localdomain (ARC0)
2639 oracle@localhost.localdomain (ARC1)
2641 oracle@localhost.localdomain (ARC2)
2643 oracle@localhost.localdomain (ARC3)
2645 oracle@localhost.localdomain (NSA2)
2649 oracle@localhost.localdomain (QMNC)
2800 oracle@localhost.localdomain (SMCO)
PSEUDO
32 rows selected.
我们可以发现,是完全一致的,实际上spid字段表示,该process在操作系统中的进程号。
每多出一个用户连接:
Oracle 24637 24635 0 05:35 ? 00:00:03 oracleaugust (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
Oracle 25548 25547 0 06:32 ? 00:00:00 oracleaugust (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
Oracle 25572 25571 0 06:32 ? 00:00:00 oracleaugust (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
Oracle 25588 25587 1 06:32 ? 00:00:00 oracleaugust (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
Oracle 25605 25603 17 06:32 ? 00:00:01 oracleaugust (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
就多出一个Oracle服务器端进程:
24637 oracle@localhost.localdomain (TNS V1-V3)
25572 oracle@localhost.localdomain (TNS V1-V3)
25588 oracle@localhost.localdomain (TNS V1-V3)
25548 oracle@localhost.localdomain (TNS V1-V3)
25605 oracle@localhost.localdomain (TNS V1-V3)