No. of processes is not matching with sessions. [message #63996] |
Fri, 03 December 2004 01:35 |
BhavinShah
Messages: 105 Registered: February 2004
|
Senior Member |
|
|
Dear frends,
I am not able to under stand following things..
I know a concept that every session will create two process server and user process.
I have count the sessions of my db.
SQL> select count(*) from v$session;
COUNT(*)
----------
54
so my no. process should be 54*2+bkg ground processes=approximately 115 Nos.
But suprisingly It is giving only 58 Nos. of process.
SQL> select count(*) from v$process;
COUNT(*)
----------
58
How this has been possible?? please let me know the actual concepts...
Bhavin
|
|
|
Re: No. of processes is not matching with sessions. [message #64000 is a reply to message #63996] |
Fri, 03 December 2004 05:00 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
both are different and are associated to each.
By definition,
V$PROCESS Contains information about the currently active processes
V$SESSION Lists session information for each current session
a process is a thread identified by ps -ef.
docs say "A process is a "thread of control" or a mechanism in an operating system that can run a series of steps".
And you know that there two types of process. user and server processes.
a connection is a sought of communication method between an user process and oracle instance.
This connection when successfully established is called as a session.
when this communication is disconnected(you logout), the session is CLOSED.
Unless you log out of your APPLICATION, the process/thread will not be closed.
see here
#
# the base process running
#
bash-2.03$ ps -ef | grep -v ttymon | grep mutation
oracle 27865 1 0 16:06:27 ? 0:27 ora_qmn0_mutation
oracle 27804 1 0 15:59:23 ? 0:00 ora_reco_mutation
oracle 27794 1 0 15:59:22 ? 0:00 ora_pmon_mutation
oracle 27810 1 0 15:59:23 ? 0:00 ora_arc0_mutation
oracle 27802 1 0 15:59:23 ? 0:04 ora_smon_mutation
oracle 27800 1 0 15:59:23 ? 0:00 ora_ckpt_mutation
oracle 27806 1 0 15:59:23 ? 0:00 ora_cjq0_mutation
oracle 27812 1 0 15:59:23 ? 0:00 ora_arc1_mutation
oracle 27798 1 0 15:59:22 ? 0:07 ora_lgwr_mutation
oracle 27796 1 0 15:59:22 ? 0:00 ora_dbw0_mutation
#
# login in as anonymous. NO session is established. no process reported.
#
bash-2.03$ sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Fri Dec 3 09:06:10 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Enter value for gname: sql
sql > !ps -ef | grep -v ttymon | grep mutation
oracle 27865 1 0 16:06:27 ? 0:27 ora_qmn0_mutation
oracle 27804 1 0 15:59:23 ? 0:00 ora_reco_mutation
oracle 27794 1 0 15:59:22 ? 0:00 ora_pmon_mutation
oracle 27810 1 0 15:59:23 ? 0:00 ora_arc0_mutation
oracle 27802 1 0 15:59:23 ? 0:04 ora_smon_mutation
oracle 27800 1 0 15:59:23 ? 0:00 ora_ckpt_mutation
oracle 27806 1 0 15:59:23 ? 0:00 ora_cjq0_mutation
oracle 27812 1 0 15:59:23 ? 0:00 ora_arc1_mutation
oracle 27798 1 0 15:59:22 ? 0:07 ora_lgwr_mutation
oracle 27796 1 0 15:59:22 ? 0:00 ora_dbw0_mutation
#
# Establish a session.
# a process is throwed in.
sql > connect mag/mag
Connected.
sql > !ps -ef | grep -v ttymon | grep mutation
oracle 27865 1 0 16:06:27 ? 0:27 ora_qmn0_mutation
oracle 27804 1 0 15:59:23 ? 0:00 ora_reco_mutation
oracle 27794 1 0 15:59:22 ? 0:00 ora_pmon_mutation
oracle 27810 1 0 15:59:23 ? 0:00 ora_arc0_mutation
oracle 27802 1 0 15:59:23 ? 0:04 ora_smon_mutation
oracle 27800 1 0 15:59:23 ? 0:00 ora_ckpt_mutation
oracle 27806 1 0 15:59:23 ? 0:00 ora_cjq0_mutation
oracle 27812 1 0 15:59:23 ? 0:00 ora_arc1_mutation
oracle 27798 1 0 15:59:22 ? 0:07 ora_lgwr_mutation
oracle 224 219 1 09:06:42 ? 0:00 oraclemutation (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 27796 1 0 15:59:22 ? 0:00 ora_dbw0_mutation
#
# close the session..but you are still using the thread!. ie. not exiting the sqlplus
# the process is available though no session is associated with it.
sql > disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
sql > !ps -ef | grep -v ttymon | grep mutation
oracle 27865 1 0 16:06:27 ? 0:27 ora_qmn0_mutation
oracle 27804 1 0 15:59:23 ? 0:00 ora_reco_mutation
oracle 27794 1 0 15:59:22 ? 0:00 ora_pmon_mutation
oracle 27810 1 0 15:59:23 ? 0:00 ora_arc0_mutation
oracle 27802 1 0 15:59:23 ? 0:04 ora_smon_mutation
oracle 27800 1 0 15:59:23 ? 0:00 ora_ckpt_mutation
oracle 27806 1 0 15:59:23 ? 0:00 ora_cjq0_mutation
oracle 27812 1 0 15:59:23 ? 0:00 ora_arc1_mutation
oracle 27798 1 0 15:59:22 ? 0:07 ora_lgwr_mutation
oracle 224 219 1 09:06:42 ? 0:00 oraclemutation (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 27796 1 0 15:59:22 ? 0:00 ora_dbw0_mutation
#
# close the process/thread. exit the originator.
# process is gone!.
sql > exit
bash-2.03$ ps -ef | grep -v ttymon | grep mutation
oracle 27865 1 0 16:06:27 ? 0:27 ora_qmn0_mutation
oracle 27804 1 0 15:59:23 ? 0:00 ora_reco_mutation
oracle 27794 1 0 15:59:22 ? 0:00 ora_pmon_mutation
oracle 27810 1 0 15:59:23 ? 0:00 ora_arc0_mutation
oracle 27802 1 0 15:59:23 ? 0:04 ora_smon_mutation
oracle 27800 1 0 15:59:23 ? 0:00 ora_ckpt_mutation
oracle 27806 1 0 15:59:23 ? 0:00 ora_cjq0_mutation
oracle 27812 1 0 15:59:23 ? 0:00 ora_arc1_mutation
oracle 27798 1 0 15:59:22 ? 0:07 ora_lgwr_mutation
oracle 27796 1 0 15:59:22 ? 0:00 ora_dbw0_mutation
bash-2.03$
|
|
|