[20130730]11G的DRCP特性.txt

简介: [20130730]11G的DRCP特性.txthttp://www.oracle-base.com/articles/11g/DatabaseResidentConnectionPool_11gR1.
[20130730]11G的DRCP特性.txt

http://www.oracle-base.com/articles/11g/DatabaseResidentConnectionPool_11gR1.php

Database Resident Connection Pool (DRCP) in Oracle Database 11g Release 1
        The database resident connection pool (DRCP) reduces the resource requirements of applications that currently don't
support connection pooling, either because it is not supported by the application infrastructure, or it has not been
implemented. The pool is managed using the DBMS_CONNECTION_POOL package. Although the package appears to support multiple
connection pools, the document states that it currently only supports the default pool name (SYS_DEFAULT_CONNECTION_POOL).

        The DRCP is started and stopped using the START_POOL and STOP_POOL procedures respectively.


--参考以上链接做一些测试:

SQL> @ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

--以sys用户启动。
SQL> execute dbms_connection_pool.start_pool;
PL/SQL procedure successfully completed.

$ ps -ef | grep -e ora_l0 -e ora_n0 | grep -v grep
503      26281     1  0 15:49 ?        00:00:00 ora_n000_test
503      27178     1  0 16:04 ?        00:00:00 ora_l000_test
503      27180     1  0 16:04 ?        00:00:00 ora_l001_test
503      27182     1  0 16:04 ?        00:00:00 ora_l002_test
503      27184     1  0 16:04 ?        00:00:00 ora_l003_test

ora_n000_XXX =>    Connection Broker Process
ora_l000_XXX => Pooled Server Process(Handles client requests in Database Resident Connection Pooling)

--使用ezconnect建立OK。
sqlplus scott/xxxx@192.168.100.XXX:1521/test.com:pooled

--也修改tnsnames.ora文件,加入如下:
testpool =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.XXX)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test.com)
          (SERVER=pooled)
          ~~~~~~~~~~~~~~~
    )
  )

--按照文档介绍,If a session remains idle for longer than the inactivity_timeout it is killed to free up space in the connection pool.

SQL> exec print_table('select * from  dba_cpool_info');
CONNECTION_POOL               : SYS_DEFAULT_CONNECTION_POOL
STATUS                        : ACTIVE
MINSIZE                       : 4
MAXSIZE                       : 40
INCRSIZE                      : 2
SESSION_CACHED_CURSORS        : 20
INACTIVITY_TIMEOUT            : 300
MAX_THINK_TIME                : 120
MAX_USE_SESSION               : 500000
MAX_LIFETIME_SESSION          : 86400
NUM_CBROK                     : 1
MAXCONN_CBROK                 : 40000
-----------------

PL/SQL procedure successfully completed.

--INACTIVITY_TIMEOUT=300秒,如果300秒就会退出。

--做一个事务,等待300秒看看:
SQL> create table t ( a number);
Table created.

SQL> insert into t values (1);
1 row created.

SQL> select sysdate from dual ;
select sysdate from dual
            *
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 27182
Session ID: 13 Serial number: 349

--重新登录,发现断开连接时使用的是rollback。
SQL> select * from t;
no rows selected


--可以修改参数,例子:
exec dbms_connection_pool.alter_param( POOL_NAME=>'SYS_DEFAULT_CONNECTION_POOL', PARAM_NAME=>'INACTIVITY_TIMEOUT', PARAM_VALUE=>'1000');

SQL> exec scott.print_table('select * from  dba_cpool_info');
CONNECTION_POOL               : SYS_DEFAULT_CONNECTION_POOL
STATUS                        : ACTIVE
MINSIZE                       : 4
MAXSIZE                       : 40
INCRSIZE                      : 2
SESSION_CACHED_CURSORS        : 20
INACTIVITY_TIMEOUT            : 1000
MAX_THINK_TIME                : 120
MAX_USE_SESSION               : 500000
MAX_LIFETIME_SESSION          : 86400
NUM_CBROK                     : 1
MAXCONN_CBROK                 : 40000
-----------------

PL/SQL procedure successfully completed.


--停止drcp使用。
SQL> execute dbms_connection_pool.stop_pool;

目录
相关文章
|
4月前
|
Python
Python 文件读写操作区别案例(r、r+、rb、w、w+、wb、a、a+、ab)
Python 文件读写操作区别案例(r、r+、rb、w、w+、wb、a、a+、ab)
96 0
|
搜索推荐 机器人
robots.txt概念和10条注意事项
robots.txt概念 如果我们网站内有某些特殊的文件不让搜索引擎收录,那怎么办? 答案是:使用一个叫做robots.txt的文件。 robots.txt文件告诉搜索引擎本网站哪些文件是允许搜索引擎蜘蛛抓取,哪些不允许抓取。 搜索引擎蜘蛛访问网站任何文件之前,需先访问robots.txt文件,然后抓取robots.txt文件允许的路径,跳过其禁止的路径。
232 0
|
关系型数据库 Oracle Linux
[20180410]为什么2个逻辑读不一样.txt
[20180410]为什么2个逻辑读不一样.txt --//昨天做测试时,发现一个小问题,链接http://blog.itpub.net/267265/viewspace-2152693/ --//发现2个逻辑读不一样,做一些简单探究.
919 0
|
SQL Oracle 关系型数据库
[20180319]直接路径读特例12c.txt
[20180319]直接路径读特例12c.txt --//昨天的测试突然想起以前遇到的直接路径读特例,在12c重复测试看看. 1.环境: SCOTT@test01p> @ ver1 PORT_STRING                    VERSION...
959 0
|
SQL Oracle 关系型数据库
[20180212]hanganalyze简单探究.txt
[20180212]hanganalyze简单探究.txt --//在我看来使用hanganalyze探究阻塞以及死锁问题,简直是耍酷,我从来不用这种方式探究与解决问题,里面的信息羞涩难以理解.
887 0
|
缓存 数据库管理
[20170810]直接路径读特例2.txt
[20170810]直接路径读特例2.txt --//以前在11.2.0.4下测试,出现直接路径读的一种特殊情况,就是使用rowid访问数据块(使用between). --//参考链接:http://blog.
808 0
|
索引
[20170328]使用with优化1例.txt
[20170328]使用with优化1例.txt --//这个以前问的问题,http://www.itpub.net/thread-1932784-1-1.html,就是使用union all的情况下谓词无法推入.
701 0
|
SQL 缓存 数据库管理
[20170308]直接路径读特例.txt
[20170308]直接路径读特例.txt --//昨天测试一些sql语句时,无意中发现出现直接路径读的一种特殊情况,就是使用rowid访问数据块(使用between).
744 0
|
网络协议 测试技术 数据库
[20161212]ezconnect与共享服务模式.txt
[20161212]ezconnect与共享服务模式.txt --EZCONNECT的好处不需配置tnsnames.ora文件,快速连接数据库.最近在使用时遇到一件登录后模式是共享模式的情况,做一个记录: 1.
794 0
|
存储 Oracle 关系型数据库
[20160112]存储还是应用问题.txt
[20160112]存储还是应用问题.txt --上个星期在ITPUB论坛里遇到几个关于磁盘性能地下的问题. --主要链接如下: http://www.itpub.
764 0