Oracle introduced the database Resident connection pooling (DRCP) in 11g. Before that, we could use dedicated or share way to link the database, dedicated way is the Oracle database default link way, without too much configuration, and about dedicated bug is very few, so, usually, We recommend that you use the dedicated method to link the database. However, when server resources are limited and the number of users who connect to the database at the same time is very large, the dedicated approach is powerless. Assuming that the concurrent user is 5000, each dedicated process needs to contain 4m of memory, and each sessioin consumes 400k of memory, we need 21.43g of memory altogether. At this point we can use the share way to connect the database, assuming that the number of shared services process is 100, then a total of 2.29g of memory, where 2g of memory allocated from the SGA. However, because there are too many bugs in the shared connection mode and some configuration work is required in order to use shared mode, it is not the database connection that we want to adopt.
In today's web-infested, database technology is facing unprecedented challenges. People familiar with web technology know that the web is a stateless technology. The user requests the webpage, the server processes the request, the connection database obtains the data and carries on the processing, disconnects the database connection, presents the Web page to the user, this is the general webpage processing flow, it has the database connection time short, the frequent connection database, the concurrency quantity big characteristic. At this point, the connection pooling technology is introduced, but most of these technologies are implemented at the client level or middleware level, with the following drawbacks "
1. Connection pooling is a single independent node, if multiple nodes need to use a common database connection, often need to be configured at each node alone, which will undoubtedly waste the database resources
2. Connection pooling is mostly pre-allocated to the database, so in the case of low user pressure, the same will continue to maintain the database connection, thus wasting the database resources
In addition, in some multi-process, single-threaded environment (such as PHP), the use of connection pooling technology is basically impossible.
The introduction of DRCP can solve these problems effectively, DRCP bind the session and server process together for caching (pool server), when the user requests to connect to the database, the first connection to the connection broker process, The broker process selects pool server from the connection pool based on connection information, assigns it to the requesting user, and thereafter, the user communicates directly with the pool server, and the broker is no longer involved until the user disconnects and the pool server is returned to the connection pool.
It is also assumed that the number of concurrent users for 5000,pool server is 100,DRCP with a memory size of 4 x (up to 35KB) = 609.9 MB, where (5000*35k) is the broker memory,
In 11g, DRCP has been pre-installed, but by default it is not enabled. To enable DRCP, you need to run the following procedure:
exec Dbms_connection_pool.start_pool;
The Dba_cpool_info view enables you to view the enabled state of DRCP.
Select from Dba_cpool_info; Connection_pool STATUS------------------------------------------------------------------------------ Sys_default_connection_pool Inactivesql> exec dbms_connection_pool.start_pool;pl/SQL process completed successfully. SQLSelect from dba_cpool_info; Connection_pool STATUS----------------------------------------------------------------------------- -sys_default_connection_pool ACTIVE
Oracle Database Resident connection pooling (hosted connection pool)