--========================
--Differences between processes, sessions, connections
--========================
When using Oracle database, connecting to the session is one of the words we often encounter. It looks like one thing, but the fact is not. A connection can be built with 0,
One or even more sessions. Ah, how about this? Yes. This is why we often misunderstand.
Individual sessions are separate and separate from other sessions, even for multiple sessions of the same connection.
Definitions between several terms (refer to Oracle 9i &10G programming Art)
Connection (Connection): A connection is a physical path from the customer to an Oracle instance. Connections can be established on the network or through the IPC mechanism. Usually in
The client process establishes a connection between a dedicated server or a scheduler.
Session: A session is a logical entity that exists in an instance. This is your session state, which is a set of memory that represents a particular session
. When it comes to "database connection", most people think of "session" first. You want to execute SQL, commit transactions, and run stored procedures on a session in the server.
Second, through the example demonstration to see the relationship between
1. No connection, no session, no process situation
[--> No session server process was established when the connection was established
[Oracle@odbp ~]$ Ps-ef | grep ORACLEORCL
Oracle 5685 5446 0 19:30 pts/1 00:00:00 grep ORACLEORCL
[ORACLE@ODBP ~]$ Sqlplus/nolog
Sql*plus:release 10.2.0.4.0-production on Mon June 27 19:30:49 2011
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Idle> Ho Ps-ef | grep oracleorcl--> Using Nolog logins is also not seeing any session server processes
Oracle 5691 5686 0 19:31 pts/0 00:00:00/bin/bash-c ps-ef | grep ORACLEORCL
2. Single connection, single session, single process
--> log in with Scott, and a corresponding server process is generated
Idle> Conn Scott/tiger
Connected.
Scott@orcl> Select Sid,serial#,username from v$session where username are not null;
SID serial# USERNAME
---------- ---------- -------------------------
159 5 SCOTT
Scott@sql> Ho Ps-ef | grep ORACLEORCL
Oracle 5696 5686 0 19:32? 00:00:00 ORACLEORCL (description= (Local=yes) (address= (PROTOCOL=BEQ))
Oracle 5699 5686 0 19:32 pts/0 00:00:00/bin/bash-c ps-ef | grep ORACLEORCL
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/