oracle连接与会话

连接与会话,很多人对这两个词的含义很是模糊。其实oracle concept上讲得是相当仔细:
Connection and session are closely related to user process but are very different in meaning。
A connection is a communication pathway between a user process and an Oracle instance. A communication pathway is established using available interprocess communication mechanisms (on a computer that runs both the user process and Oracle) or network software (when different computers run the database application and Oracle, and communicate through a network).
A session is a specific connection of a user to an Oracle instance through a user process. For example, when a user starts SQL*Plus, the user must provide a valid user name and password, and then a session is established for that user. A session lasts from the time the user connects until the time the user disconnects or exits the database application.
也就是就连接与会话和用户进程紧密相关,但二者又具有不同的含义。
连接是用户进程和oracle实例间的通信通道。数据库用户可采用三种方式连接到oracle instance:1、用户登录到运行Oracle 实例的操作系统上,然后启动访问该系统中的数据库的应用程序或工具。通信路径是使用主机操作系统上的进程间通信机制建立的。2、用户在本地计算机上启动应用程序或工具,然后通过网络连接到运行Oracle 实例的计算机。在这个称为客户机/服务器的配置中,用户和Oracle 服务器使用网络软件进行通信。3、在三层连接中,用户计算机通过网络与应用程序服务器或网络服务器进行通信,这些服务器又通过网络与运行Oracle 实例的计算机连接。例如,用户在网络中的一台计算机上运行浏览器来使用位于NT 服务器上的应用程序,该NT 服务器又从UNIX 主机上运行的Oracle 数据库中检索数据。说白了所谓的建立连接,就是通过某个工具能够与服务器通信,即与服务进程连接。
会话是用户与Oracle 实例的一种特定连接。例如,当用户启动 SQL*Plus 时必须提供有效的用户名和密码,之后 Oracle 为此用户建立一个会话。从用户开始连接到用户断开连接(或退出数据库应用程序)期间,会话一直持续。说白了就是conn /as sysdba这就建立了一个session,即通过oracle内部的检查,包括用户名,密码,权限等等,disconnect /as sysdba或关闭应用工具就退出session。
Tags: 

延伸阅读

最新评论

发表评论