Oracle session Introduction

Source: Internet
Author: User

What is session?
Generally speaking, session is a context between the communication end and the communication end ). This context is a piece of memory on the server side: it records the client machine of the connection, the application through, and the user logon information [in pl/SQL developer, you can use Tools --> Sessions to view the session of the current database]. The session is created at the same time as the connection, and the two are descriptions of the same thing at different levels. In short, connection is the communication link between the physical client and the server segment, and session is the communication interaction between the logical user and the server.

If a user logs on to the Oracle server in oracle, the user has the "create session" permission of oracle. Oracle allows the same user to establish multiple connections to the same server on the same client. from the oracle view V $ session, we can see [select * from v $ session;]. Each session represents an interaction between the user and the server. Just as two countries can carry out a lot of negotiations at the same time, such as economic, and environmental. The negotiation on the economy will not affect the environment negotiation. The background process PMON will test the user's connection status at intervals. If the connection is disconnected, PMON will clean up the site and release related resources.

In specific application scenarios, connction and session have many situations:
1. sqlplus login to oracle
This scenario is easy to understand. A connection corresponds to a session.

2. log on to oracle using other client tools
For example, pl/SQL developer logs on to oracle. Pl/SQL developer can set whether each window shares the same session. If you want to debug stored procedures or functions in the debugging window, you must set it to share session. If it is set to non-shared, www.bkjia.com opens an operation window each time. pl/SQL developer creates a new connection and session using the account and password originally entered.

3. log on to oracle using IIS
In this case, IIS is actually logging on to oracle. Connection and session establishment are related to the iis mechanism.
"For Oracle, the number of secure Sessions should be Sessions = (IIS process number) * (min pool size )."
IIS process: in IIS6.0, a new process isolation mode is used to respond to user requests. In IIS manager, you can set the maximum number of processes in the application pool. For new webapplication requests, the iisprogress manager starts multiple w3wp.exe requests to respond.

4. Other situations are to be supplemented by heroes

Orcale session memory
There are two types of oracle connections: exclusive and shared.
In the case of an exclusive connection, Sessions (such as cursors, sorting, and SQL zones) are allocated in PGA.
In the case of a shared connection, part of the session (such as UGA) is allocated in the larg pool of SGA.

Oracle session and process
Each process in oracle has a corresponding session.
Process is divided
USER process availability condition in V $ session: $ session. type = 'user'. query.
Backend process availability condition in V $ session: $ session. type = 'background' query.

Common background processes:
SMON, PMON, DBWR, LGWR, MMAN, MRP, RFS, RECO, CKPT, ARCH, Dnnn, Snnn, LMON, LMD0, QMNn, TRWR, WMON, LCKnnn, SNPnnn, MMON, DMON, SNP

Session-related initialization parameters:
Process: The number of oracle connections (sessions) is related to the number of processes in the parameter file. Their relationships are as follows: sessions = (1.1 * process + 5). We can modify inia. this process parameter of ora changes the maximum number of sessions that can be connected.
Workarea_size_policy: the PGA can be manually managed or automatically managed. In AUTO mode, up to 5% M or 100 M can be used for each session.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.