您好,欢迎访问一九零五行业门户网

oracle官方文档对连接和会话的解释

什么是session 会话(session)是oracle数据库服务器对连接数据库的用户进行记录的一种手段。 通俗来讲,session 是通信双方从开始通信到通信结束期间的一个上下文(context)。这个上下文是一段位于服务器端的内存:记录了本次连接的客户端机器、通过哪个应用
什么是session
会话(session)是oracle数据库服务器对连接数据库的用户进行记录的一种手段。
通俗来讲,session 是通信双方从开始通信到通信结束期间的一个上下文(context)。这个上下文是一段位于服务器端的内存:记录了本次连接的客户端机器、通过哪个应用程序、哪个用户在登录等信息[在pl/sql developer中,通过tools-->sessions可以查看当前数据库的session]。session 是和connection同时建立的,两者是对同一件事情不同层次的描述。简单讲,connection是物理上的客户机同服务器段的通信链路,session是逻辑上的用户同服务器的通信交互。session被应用于oracle层次而非操作系统层次.在不考虑通过专用服务器或共享服务器进行登录的情况下,这个参数限制了对指定实例的并发登陆数.
oracle中一个用户登录oracle服务器的前提,就是该用户具有oracle的 “create session”权限。oracle允许同一个用户在同一个客户机上建立多个同服务器的连接,这一点从oracle的视图v$session中可以看到[select * from v$session;]。每个session都代表了用户与服务器的一个交互。就像两个国家之间可以同时开展很多谈判,经济的,环境的等等。关闭了有关经济的谈判,不会影响到环境谈判的进行。后台进程pmon会每隔一段时间,就会测试用户连接状况,如果连接已断开,pmon会清理现场,释放相关的资源。
官方解释
1.1 connection:
   a connection is a physical path from a client to an oracle instance. a connection is established either over a network or over an ipc mechanism. a connection is typically between a client process and either a dedicated server or a dispatcher. however,using oracle’s connection manager (cman), a connection may be between a client and cman, and cman and the database.
1.2 session
   a session is a logical entity that exists in the instance. it is your session state, or a collection of data structures in memory that represents your unique session. it is what would come first to most people’s minds when thinking of a “database connection.” it is your session in the server, where you execute sql, commit transactions, and run stored procedures.
1.3 connection vs. session
   a connection may have zero, one, or more sessions established on it. each session is separate and independent,even though they all share the same physical connection to the database. a commit in one session does not affect any other session on that connection. in fact, each session using that connection could use different user identities!
   in oracle, a connection is simply a physical circuit between your client process and the database instance—a network connection, most commonly. the connection may be to a dedicated server process or to a dispatcher. as previously stated, a connection may have zero or more sessions, meaning that a connection may exist with no corresponding sessions. additionally, a session may or may not have a connection. using advanced oracle net features such as connection pooling, a physical connection may be dropped by a client, leaving the session intact (but idle). when the client wants to perform some operation in that session, it would reestablish the physical connection.
其它类似信息

推荐信息