Oracle OCI 客户端缓存不工作

发布于 2024-10-20 12:43:01 字数 704 浏览 4 评论 0原文

我正在使用 Oracle Database 11g 版本 11.2.0.2.0 并尝试启用 oci 客户端缓存。它不起作用。 我为启用它所做的配置更改是 -

  1. 通过将服务器端参数“client_result_cache_size”设置为 10485760 (10 MB) 启用客户端结果集缓存 设置
  2. 上述参数后重新启动 oracle 实例
  3. 通过执行语句 ALTER TABLE 添加表注释emp RESULT_CACHE(模式强制)。我稍后通过查询用户表验证了注释是否已应用。
  4. 在客户端(即 JDBC 驱动程序)启用语句缓存。
  5. 使用准备好的语句来执行查询,以便启动语句缓存。从驱动程序日志中,我验证了第一个查询之后后续查询的执行使用了相同的语句句柄。

执行 3 次 select 准备好的语句查询后,我检查了 CLIENT_RESULT_CACHE_STATS$ 视图。但这个视图没有产生任何行。

作为故障排除的一部分,我什至尝试将 /*+ RESULT_CACHE */ 提示添加到查询中,但视图没有给出任何结果。

从分析器(flextracer)中我可以看到仍然对服务器进行 OCI 调用以获取选择查询的结果集。另外,在启用 sql 跟踪时,我可以从 tkprof 看到,每次执行查询都会增加在服务器上获取的行数,这表明 OCI 中的客户端结果集缓存不起作用。

我是否遗漏了任何步骤?

提前致谢。

I am using Oracle Database 11g Release 11.2.0.2.0 and trying to enable the oci client cache. It isn't working.
The configuration changes I made to enable it are -

  1. Enabled the client result set cache by setting the server side parameter 'client_result_cache_size' to 10485760 (10 MB)
  2. Restarted the oracle instance after setting the above parameter
  3. Added a table annotation by executing the statement ALTER TABLE emp RESULT_CACHE (MODE FORCE). I verified that the annotation is applied by query the user table later.
  4. Enabled statement caching on the client side i.e. on the JDBC driver.
  5. Used prepared statements to execute the query so that statement caching kicks in. From the driver logs I verified that execution of subsequent queries after the first one used the same statement handle.

After executing the select prepared statement query for three times I checked the CLIENT_RESULT_CACHE_STATS$ view. But this view didn't result in any rows.

As part of troubleshooting I even tried adding the /*+ RESULT_CACHE */ hint to the query but the view didn't gave any result.

From the profiler (flextracer) I could see that OCI calls are still made to the server to fetch the result set of the select query. Also on enabling sql trace I could see from tkprof that every execution of the query increased the number of rows fetched on the server which indicates that the client result set caching in OCI isn't working.

Are there any steps which I have missed?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不奢求什么 2024-10-27 12:43:01

我意识到我尝试启用的缓存功能在标准版中不可用。它仅在企业版中可用 - http:// download.oracle.com/docs/cd/B28359_01/license.111/b28287/editions.htm#BABDJGGI

I realized that the caching functionality I am trying to enable is not available in Standard Edition. It's only available in Enterprise Edition - http://download.oracle.com/docs/cd/B28359_01/license.111/b28287/editions.htm#BABDJGGI

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文