Oracle 11g DRCP connection method-Basic Principle

Source: Internet
Author: User
Tags connection pooling dedicated server

Learning Oracle is a complex and tedious process. In front of the vast array of official Oracle data, new features, MOS data, and a variety of Internal knowledge, we always feel powerless and overwhelmed. However, this is often the pleasure of our constant persistence, accumulation, and pursuit.
 
In Oracle 11g, the third Connection method, Database Resident Connection Pooling (DRCP), is proposed to break through the traditional dedicated/shared Connection ). In this article, we will discuss this technology together.
 
1. From Dedicated Server to Shared Server
 
Oracle Client Process connects to Server Process in two traditional ways: Dedicated Server and Shared Server. When the Client is connected to the Oracle Server, the listener is used by default to locate the Oracle instance service. Only the sub-Process from the listener fork requests a Server Process from the Instance to remotely communicate with the Client Process. Different connection methods are reflected in how the database instance provides the Server Process and manages the Process after receiving the Server Process request.
 
The Dedicated Server mode is also called the Dedicated connection mode. Oracle Instance creates a new Server Process and Client Process for remote communication. In the entire Client Process request Process, Server Process only provides services for this Client. UGA information is also stored in the PGA space of Server Process. When the session ends and the Client connection is interrupted, the Server Process will be cleared and the allocated memory will be recycled. The Dedicated method is the most commonly used database connection method. When a persistent session or front-end application uses the connection pool component, the advantages of the Dedicated method are obvious.
 
The Mode corresponding to Dedicated Server is Shared Server. In this mode, the Oracle instance maintains two types of Server Process: Dispatcher DXXX and SXXX ).
 
 
SQL> select addr, pid, spid, username, program from v $ process where program like '% 100 ';
 
ADDR PID SPID USERNAME PROGRAM
-----------------------------------------------------------------
6D24BA1C 13 648 system oracle. EXE (D000)
6D24C00C 14 1736 system oracle. EXE (S000)
 
 
 
When the listener sends a Server Process allocation request to the database instance, in Shared Server mode, the listener allocates the Server Process to the distributed Process DXXX request. DXXX allocates a Server Process for use based on the current idle Server. After the Client is used, Server Process (SXXX) is not released, but is re-controlled by D000. The system also maintains a stable SXXX number based on the parameter settings.
 
 
SQL> show parameter shared_servers
 
NAME TYPE VALUE
-----------------------------------------------------------------------------
Max_shared_servers integer
Shared_servers integer 1
 
 
The emergence of the Shared Server connection mode is related to the development of short sessions and highly concurrent Internet applications. The cost for each Server Process creation and recovery is high. If the application does not have a middle-layer connection pool, but a high-concurrency Server Process is created and quickly recycled, this is a high pressure on the database.
 
From the perspective of application design and development, connection pool management has penetrated into mainstream application system frameworks. The shared server method is not widely used in practice.
 
2. Database Resident Connection Pooling (DRCP)
 
From the perspective of the software model, Shared Server also wants to implement a connection pool at the database level. This is achieved at the Oracle 11g. The Oracle resident connection pool (DRCP) is a new feature that allows shared connections between Multi-Process and Multi-Threads.
 
Shared server relieves the problem of Server process IDEL and frequent creation and destruction of Server process to some extent. However, the Shared Server does not solve the Session data sharing problem. This model is effective when a client needs to hold a session for a long time and other clients do not have a large number of session requirements. However, when each request session is short (short session) and database activities require multiple session interactions, DRCP is an ideal connection pool model.
 
The new DRCP feature mainly targets high concurrent connections when applications access the database. The DRCP connection pool caches Server and Session information to provide connection sharing for multiple accessed applications.
 
Like Shared Server, the DRCP front-end has a Connection Broker, which is responsible for sharing the Application Middleware Connection requirements and managing Connection pools on database instances. When the Application Middleware wants the Broker to initiate a connection request, the Broker will find the idle connection from the connection pool. After the interaction ends, the Server Process is released back to the connection pool for reuse.
 
Different from shared server. When the connection pool in the shared pool is allocated, it is equivalent to the dedicated server mode.

  • 1
  • 2
  • Next Page

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.