Oracle:非池连接和 DRCP 之间的区别

标签 oracle database-connection connection-pooling

我实际上正在阅读 Oracle-cx_Oracle教程。

在那里我遇到了非池连接和 DRCP,基本上我不是 DBA,所以我用谷歌搜索但找不到任何东西。

那么有人可以帮助我了解它们是什么以及它们之间有何不同。

谢谢你。

最佳答案

DRCP 代表 Database Resident Connection Pooling与“非池化”连接相反

简而言之,使用 DRCP,Oracle 将缓存所有打开的连接,将它们作为一个池,并将池中的连接用于 future 的请求。

这样做的目的是避免在某些现有连接可用/空闲时打开新连接,从而保护数据库资源并获得时间(打开新连接的时间)。

如果池中的所有连接都被使用,则会自动创建一个新连接(由 Oracle)并将其添加到池中。

在非池连接中,连接由查询数据库的应用程序创建并(理论上)关闭。

例如,在查询数据库的静态 PHP 页面上,您始终使用相同的方案:

  • 打开数据库连接
  • DB查询
  • 关闭数据库连接

  • 你知道你的计划是什么。

    现在假设您有一个动态 PHP 页面(使用 AJAX 或其他东西),只有当用户执行某些特定操作时才会查询数据库,该方案变得不可预测。 DRCP 可以使您的数据库变得健康,尤其是当您有很多用户和可能的请求时。

    官方文档中的引用相当概括了这个概念以及何时应该使用它:

    Database Resident Connection Pool (DRCP) is a connection pool in the server that is shared across many clients. You should use DRCP in connection pools where the number of active connections is fairly less than the number of open connections. As the number of instances of connection pools that can share the connections from DRCP pool increases, the benefits derived from using DRCP increases. DRCP increases Database server scalability and resolves the resource wastage issue that is associated with middle-tier connection pooling.

    关于Oracle:非池连接和 DRCP 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40373609/

    相关文章:

    mysql - SQL 按 ASC 和 DESC 排序

    c# - 将许多文本文件读入 SQL Server Express

    session - Firebird:为什么 ALTER TRIGGER 对其他 session /连接没有影响?

    c# - 与 Microsoft Enterprise Library 共享 MySQL 连接

    Postgresql - 准备好的语句与连接池 - 这是一个权衡吗?

    javascript - 如何循环这个 PL/SQL 语句,以便它在我的 Google map 上绘制多个标记?

    sql - 在Oracle中不使用in语句删除两条记录

    oracle - 关于pl/sql异常的问题

    mysql - 无法通过不同域连接到 MySQL 服务器

    php - 数据库连接池真的那么重要吗?