process和session的總結

lusklusklusk發表於2017-02-27

多個client process對應一個server process,如果資料庫執行在共享伺服器方式
一個client process對應一個server process,如果資料庫執行在專用伺服器方式

之所以,oracle服務端的session引數值會大於process引數值的原因是,一個process下的一個session可能會產生 recursive sessions 歸會話

select paddr,count(sid)  from v$session group by paddr having count(sid)>1  --可以查到 一個process id可以對應好多個session id


Multiple sessions can exist concurrently for a single database user. user hr can have multiple connections to a database. In dedicated server connections, the database creates a server process on behalf of each connection. Only the client process that causes the dedicated server to be created uses it. In a shared server connection, many client processes access a single shared server process .

對於單個資料庫使用者,可以同時存在多個會話。 使用者hr可以與資料庫建立多個連線。 在專用伺服器連線中,資料庫為每個連線建立伺服器程式。 只有導致建立專用伺服器的客戶端程式才會使用它。 在共享伺服器連線中,許多客戶端程式訪問單個共享伺服器程式。


session

A logical entity in the database instance memory that represents the state of a current user login to a database. A single connection can have 0, 1, or more sessions established on it .

資料庫例項記憶體中的邏輯實體,表示當前使用者登入資料庫的狀態。 單個連線可以在其上建立0,1或更多會話


process

A mechanism in an operating system that can run a series of steps. By dividing the work of Oracle Database and database applications into several processes, multiple users and applications can connect to a single database instance simultaneously.

Oracle processes include server processes and background processes.

作業系統中可以執行一系列步驟的機制。 透過將Oracle資料庫和資料庫應用程式的工作分成多個程式,多個使用者和應用程式可以同時連線到單個資料庫例項。

Oracle流程包括伺服器程式和後臺程式。


PROCESSES引數

PROCESSES specifies the maximum number of operating system user processes that can simultaneously connect to Oracle. Its value should allow for all background processes such as locks, job queue processes, and parallel execution processes.

The default values of the SESSIONS and TRANSACTIONS parameters are derived from this parameter. Therefore, if you change the value of PROCESSES, you should evaluate whether to adjust the values of those derived parameters.

PROCESSES指定可以同時連線到Oracle的最大作業系統使用者程式數。 它的值應該允許所有後臺程式,例如鎖,作業佇列程式和並行執行程式。

SESSIONS和TRANSACTIONS引數的預設值是從此引數派生的。 因此,如果更改PROCESSES的值,則應評估是否調整這些派生引數的值。


SESSIONS引數

SESSIONS specifies the maximum number of sessions that can be created in the system.Because every login requires a session, this parameter effectively determines the maximum number of concurrent users in the system. You should always set this parameter explicitly to a value equivalent to your estimate of the maximum number of concurrent users, plus the number of background processes, plus approximately 10% for recursive sessions .

In a shared server environment, the value of PROCESSES can be quite small. Therefore,Oracle recommends that you adjust the value of SESSIONS to approximately 1.1 * total number of connections.

SESSIONS指定可以在系統中建立的最大會話數。因為每次登入都需要會話,所以此引數有效地確定系統中的最大併發使用者數。您應該始終將此引數顯式設定為等於最大併發使用者數的估計值,加上後臺程式數, 再加上遞迴會話的大約10%

在共享伺服器環境中,PROCESSES的值可能非常小。因此,Oracle建議您將SESSIONS的值調整為大約1.1 *總連線數。


Dedicated Server Processes

In dedicated server connections, the client connection is associated with one and only one server process (see "Dedicated Server Architecture"). On Linux, 20 client processes connected to a database instance are serviced by 20 server processes.

Each client process communicates directly with its server process. This server process is dedicated to its client process for the duration of the session. The server process stores process-specific information and the UGA in its PGA (see "PGA Usage in Dedicated and Shared Server Modes").

專用伺服器連線中,客戶端連線與一個且僅一個伺服器程式相關聯 (請參閱“專用伺服器體系結構”)。在Linux上,連線到資料庫例項的20個客戶端程式由20個伺服器程式提供服務。

每個客戶端程式直接與其伺服器程式通訊。此伺服器程式專用於會話期間的客戶端程式。伺服器程式在其PGA中儲存特定於程式的資訊和UGA(請參閱“專用和共享伺服器模式下的PGA使用”)。


Shared Server Processes

In shared server connections, client applications connect over a network to a dispatcher process, not a server process (see "Shared Server Architecture"). For example, 20 client processes can connect to a single dispatcher process.

The dispatcher process receives requests from connected clients and puts them into a request queue in the large pool (see "Large Pool"). The first available shared server process takes the request from the queue and processes it. Afterward, the shared server place the result into the dispatcher response queue. The dispatcher process monitors this queue and transmits the result to the client.

Like a dedicated server process, a shared server process has its own PGA. However, the UGA for a session is in the SGA so that any shared server can access session data.

在共享伺服器連線中,客戶端應用程式透過網路連線到排程程式程式,而不是伺服器程式(請參閱“共享伺服器體系結構”)。例如,20個客戶端程式可以連線到單個排程程式程式。

排程程式程式接收來自已連線客戶端的請求,並將它們放入大型池中的請求佇列中(請參閱“大型池”)。第一個可用的共享伺服器程式從佇列中獲取請求並對其進行處理。之後,共享伺服器將結果放入排程程式響應佇列。排程程式程式監視此佇列並將結果傳輸到客戶端。

與專用伺服器程式一樣,共享伺服器程式也有自己的PGA。但是,會話的UGA位於SGA中,因此任何共享伺服器都可以訪問會話資料。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2134382/,如需轉載,請註明出處,否則將追究法律責任。

相關文章