[20130730]11G的DRCP特性.txt

[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;

时间: 2024-07-30 10:53:28

[20130730]11G的DRCP特性.txt的相关文章

[20111220]listagg 11G的新特性.txt

[20111220]listagg 11G的新特性.txt 显示相关的数据在一行,找到一个站点,总结了N多方法: www.oracle-base.com/articles/misc/StringAggregationTechniques.php 我第一个知道的是:SELECT deptno,       LTRIM(MAX(SYS_CONNECT_BY_PATH(ename,','))       KEEP (DENSE_RANK LAST ORDER BY curr),',') AS empl

[20170824]11G备库启用DRCP连接.txt

[20170824]11G备库启用DRCP连接.txt --//参考链接: http://blog.itpub.net/267265/viewspace-2099397/ blogs.oracle.com/database4cn/adg%e5%a4%87%e5%ba%93%e7%9a%84drcp%e8%bf%9e%e6%8e%a5%e6%8a%a5%e9%94%99oci-21500%e8%a7%a3%e5%86%b3%e4%b8%80%e4%be%8b 1.测试环境: SYS@bookdg>

[20131017]11G下truncate的新特性.txt

[20131017]11G下truncate的新特性.txt http://www.askmaclean.com/archives/know-high-water-mark-truncate.html 11.2.0.2中出现truncate的新特性,截断表目前有了新选项:即drop all storage. 测试看看:SCOTT@test> @verBANNER--------------------------------------------------------------------

盘点 Oracle 11g 中新特性带来的10大性能影响

盘点 Oracle 11g 中新特性带来的10大性能影响 原创 2017-08-02 盖国强 数据和云 Oracle的任何一个新版本,总是会带来大量引人瞩目的新特性,但是往往在这些新特性引入之初,首先引起的是一些麻烦,因为对于新技术的不了解.因为对于旧环境的不适应,从Oracle产品到技术服务运维,总是要走过一个磨合的长期过程. 请注意:我们并不推荐大家盲目的关闭和摒弃Oracle的新特性,我们建议大家在遇到问题时,做出适合自己的调整. 就此盘点一下 Oracle 11g 中,那些新特性带来的新

[20170516]11G use_large_pages参数2.txt

[20170516]11G use_large_pages参数2.txt //前面我提到如果设置use_large_pages=auto.设置页面大小不足时,oracle会oradism经常修改内核参数vm.nr_hugepages. //忘记测试是否在退出后可以收回.链接如下: http://blog.itpub.net/267265/viewspace-2135210/ --//不知道什么回事,以前写的,忘记发了,补上. 1.环境 SYS@book> @ &r/ver1 PORT_STR

[20150929]11g关于行链接.txt

[20150929]11g关于行链接.txt --曾经写过block record flag: http://blog.itpub.net/267265/viewspace-1753924/ http://blog.itpub.net/267265/viewspace-1753933/ --总结如下: #define KDRHFK 0x80 Cluster Key                                    =>使用K表示 #define KDRHFC 0x40 Clu

[20170207]11G审计日志清除.txt

[20170207]11G审计日志清除.txt --//11G缺省打开了许多审计,比如登录审计(我个人建议仅仅审计不成功的登录,特别对登录密集的系统),如果系统上线时没有关闭或者取 --//消一些审计,sys.aud$在system表空间,会导致空间异常增加,而且占用system表空间不是很合理.必须建立良好的监测清理机制. 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ---

[20150511]关于11G Direct Path Read.txt

[20150511]关于11G Direct Path Read.txt --前一阵子被别人问到升级到11G要注意那些细节,我给对方讲了审计,用户口令管理(大小写),sql tuning advisor,auto space advisor, --以及Direct Path Read等问题,对方问了很多Direct Path Read相关的问题. --实际上就是讲简单就是一些表大于一定的情况下,读取数据从磁盘,绕过buffer cache的情况. --如果有用户使用Direct Path Rea

[20170410]11G ora_sql_txt是否有效.txt

[20170410]11G ora_sql_txt是否有效.txt --链接问的问题: http://www.itpub.net/thread-2086256-1-1.html --我写的测试脚本,自己测试看看: 1.环境: SYS@test> @ ver1 PORT_STRING                    VERSION        BANNER