Idle Server Processes
Suren, September 23, 2002 - 10:51 am UTC
Tom,
1) Do you mean to say that a server(unix) process would be
created even when the authentication fails and if the
code doesn`t close the connection it would remain there
sitting in an idle state. ???
2) If yes, how would the DCD( Dead Client Detection ) work
for my scenario.
Thanks,
Suren
September 23, 2002 - 1:11 pm UTC
1) in order to authenticate -- you need a process! so yes, process created AND THEN authentication.
The code *should not* have to close the connection (in fact, the connection object doesn't even get returned to me for closing using the 8174 jdbc drivers from oracle)
I cannot replicate your issue using our jdbc drivers -- can you?
2) it would not, that cleans up a session, you don't have a session.
single process , multiple sessions ?
Ram, September 24, 2002 - 3:00 am UTC
Hello Tom,
This particular sentence is confusing - 'a process is created before authentication and a session is established after being authenticated. a process can have multiple sessions'.
how can a single process support multiple sessions ?
a client (lets say , sqlplus) gets connected to the server (for the very first time ) - a session is established.
now, if i open another sqlplus and connect , will that be a separate session but with the same process ? how ?
does this mean that the process part is client terminal driven ? that is, a client terminal to the server is a single process where as client appls getting connected to the server is multiple sessions.
i am missing something here.
September 24, 2002 - 7:41 am UTC
A single client program CAN if it wants, open more then one session.
SQLPlus does this when you set autotrace on for example. The V$ queries are executed in ANOTHER SESSION so as to not affect the V$ queries themselves.
If you fire up sqlplus two times tho -- you'll have two processes, two sessions.
If you are writing your OWN program, you can fire up multiple sessions on the same physical connection -- if you want.
Good to know
Kees Oskam, December 17, 2003 - 1:46 pm UTC
I was looking for situations where one process could have more than one session. Well, this clearly answers it. Now I want to find out how PGA memory is alloceted to processes versus sessions. That part is not yet clear to me.
December 18, 2003 - 8:48 am UTC
PGA is process memory -- meaning, allocated in a process. Session memory may be allocated in a processes PGA (dedicated server more) or in the SGA (shared server mode).
Both modes interestingly allow a single process to have more then one session ;)
I still have a question...
Kumar, April 27, 2005 - 7:07 am UTC
I am using Oracle jdbc thin driver 817. I have tested the program you have given in the explination with a small change. I have stoped the oracle using svrmgrl> shutdown immediate.
Now till the program exits the process hang. I have seen using ps -ef | grep shyam
(where shyam is my sid)
Why is it so? When DriverManager.getConnection fails with ORA-01034 and fails to get connection, should it not clean the process it has started. Only when the program exits the processes gets cleaned up.
April 27, 2005 - 8:14 am UTC
the act of connecting to a database involves a couple of steps, you can be connected without any sessions, you can have a single connection with many sessions, you can even have a session without a connection.
The act of trying to connect to a database instance creates the process, until you totally disconnect from there, it will remain.