Oracle数据库中的cursor_sharing参数是一个非常重要的参数,它主要用于控制SQL语句的解析行为。这个参数有三个可能的值:EXACT、FORCE和SIMILAR,每个值都有其特定的用途和影响。 首先,我们来看看EXACT。这是cursor_sharing参数的默认值。当这个参数设置为EXACT时,Oracle会对每个提交的SQL语句进行精确的解
二、在Cursor_sharing参数值不同的时对SQL的影响: 2.1 创建实验环境: ---首先创建一张jack表--- 1 SQL>createtable jack (idint,namevarchar2(10));23Tablecreated.4---产生一些数据--- 5 SQL>insertinto jackvalues(1,'aa');671row created.89 SQL>insertinto jackvalues(2,'bb');10111row created....
for applications with many similar statements, setting CURSOR_SHARING can significantly improve cursor sharing, resulting in reduced memory usage, faster parses, and reduced latch contention. Consider this approach when statements in the shared pool differ only in the values of literals...
The best practice is to write sharable SQL and use the default of EXACT for CURSOR_SHARING. However, for applications with many similar statements, setting CURSOR_SHARING can significantly improve cursor sharing, resulting in reduced memory usage, faster parses, and reduced latch contention. Consider...
cursor_sharing这个参数对系统性能和稳定性都非常重要,可惜经常被忽略,建议使用该参数的默认值:即 cursor_sharing=EXACT,而不是FORCE或similar。 5.总结 使用绑定变量的地方,必须使用绑定变量。这个对于OLTP系统来说是铁律,不容置疑,cursor_sharing=FORCE通常就是为了解决该使用绑定变量而没有使用绑定变量的情况。但是绝...
一.AdaptiveCursorSharing概述在Oracle10g和11g中对绑定变量的处理,已经有所不同,在Oracle10g中,绑定变量相对比较简单,当使用绑定变量的SQL第一次执行时,会进行硬解析,生成plan和cursor。在这个过程中,Oracle会使用bindpeeking,即将绑定变量的值带入,从而选择最优的一个plan。以后每次执行都使用这个plan。 在...
Oracle参数之cursor_sharing 一、Cursor_sharing简介: 这个参数是用来告诉Oracle在什么情况下可以共享游标,即SQL重用。 Cursor_sharing参数有3个值可以设置: 1)、EXACT:通常来说,exact值是Oracle推荐的,也是默认的,它要求SQL语句在完全相同时才会重用,否则会被重新执行硬解析操作。
--只有SQL 语句完全相同的情况下,才会使用相同的cursor,即执行计划。 Notes: (1)If you set CURSOR_SHARING, then Oracle recommends the FORCE setting unless you are in a DSS environment. FORCE limits the growth of child cursors that can occur when the setting is SIMILAR. ...
阿里云为您提供专业及时的oracle数据库一键上云cursor_sharing的相关问题及解决方案,解决您最关心的oracle数据库一键上云cursor_sharing内容,并提供7x24小时售后支持,点击官网了解更多内容。
执行上述sql语句之后,使用select NAME,value from v$sysstat where name='parse count (hard)'查询,其硬解析的值依然是10207,这个就是将cursor_sharing的值为force 的作用,只要sql语句相同,不管谓词值是否相同,都会当成相同的sql,重用之前的cursor,不会进行硬解析。