Oracle 11g新特性之DRCP(Database resident connection pooling)

以下是oracle administrator's guid中对DRCP的定义:

Database resident connection pooling (DRCP) provides a connection pool in the database server for typical Web application usage scenarios where the application acquires a database connection, works on it for a relatively short duration, and then releases it.

书中的举例如下:
memory required for each session is 400 KB and the memory required for each server process is 4 MB. The pool size is 100 and the number of shared servers used is 100. If there are 5000 client connections, the memory used by each configuration is as follows:

 Dedicated Server
 Memory used = 5000 X (400 KB + 4 MB) = 22 GB
 Shared Server
 Memory used = 5000 X 400 KB + 100 X 4 MB = 2.5 GB
 Database Resident Connection Pooling
 Memory used = 100 X (400 KB + 4 MB) + (5000 X 35KB)= 615 MB

100个共享服务进程能够应付5000个并发客户连接,而为了管理这5000个并发连接,只需给DRCP broker分配175M的内存空间即可。

DRCP 配置
SQL> exec dbms_connection_pool.configure_pool(maxsize=>10,inactivity_timeout=>60);
SQL> exec sys.dbms_connection_pool.start_pool();
SQL> exec sys.dbms_connection_pool.stop_pool();

客户端连接方法:
第一种:examplehost.company.com:1521/books.company.com:POOLED
第二种:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp) (HOST=myhost)
(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=sales)
(SERVER=POOLED)))

以下是关于DRCP的限制:
You cannot perform the following activities with pooled servers:
1.Shut down the database
2.Stop the database resident connection pool
3.Change the password for the connected user
4.Use shared database links to connect to a database resident connection pool
5.Use Advanced Security Option (ASO) options such as encryption, certificates, and so on
6.Use migratable sessions on the server side directly by using the OCI_MIGRATE option or indirectly through OCIConnectionPool

你可能感兴趣的:(oracle,新特性,11g,drcp,Pooled)