ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Enabling Database Resident Connection Pooling

Enabling Database Resident Connection Pooling

原创 Linux操作系统 作者:ygzhou518 时间:2012-03-30 16:57:23 0 删除 编辑


Oracle Database includes a default connection pool called SYS_DEFAULT_CONNECTION_POOL. By default, this pool is created, but not started. To enable database resident connection pooling, you must explicitly start the connection pool.

To enable database resident connection pooling:

  1. Start the database resident connection pool, as described in "Starting the Database Resident Connection Pool".

  2. Route the client connection requests to the connection pool, as described in "Routing Client Connection Requests to the Connection Pool".

Starting the Database Resident Connection Pool

To start the connection pool, use the following steps:

  1. Start SQL*Plus and connect to the database as the SYS user.

  2. Issue the following command:

    SQL> EXECUTE DBMS_CONNECTION_POOL.START_POOL();
    

Once started, the connection pool remains in this state until it is explicitly stopped. The connection pool is automatically restarted when the database instance is restarted if the pool was active at the time of instance shutdown.

In an Oracle Real Application Clusters (Oracle RAC) environment, you can use any instance to manage the connection pool. Any changes you make to the pool configuration are applicable on all Oracle RAC instances.

Routing Client Connection Requests to the Connection Pool

In the client application, the connect string must specify the connect type as POOLED.

The following example shows an easy connect string that enables clients to connect to a database resident connection pool:

examplehost.company.com:1521/books.company.com:POOLED

The following example shows a TNS connect descriptor that enables clients to connect to a database resident connection pool:

(DESCRIPTION=
   (ADDRESS=(PROTOCOL=tcp) (HOST=myhost/IP)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=sales)(SERVER=POOLED))
 )

Disabling Database Resident Connection Pooling

To disable database resident connection pooling, you must explicitly stop the connection pool. Use the following steps:

  1. Start SQL*Plus and connect to the database as the SYS user.

  2. Issue the following command:

    SQL> EXECUTE DBMS_CONNECTION_POOL.STOP_POOL();
    

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24867586/viewspace-719960/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Shutdown Timeout
下一篇: Heavy swapping
请登录后发表评论 登录
全部评论

注册时间:2011-02-11

  • 博文量
    167
  • 访问量
    364681