ANNOUNCEMENT: Deprecating the cursor_sharing = ‘SIMILAR’

ANNOUNCEMENT: Deprecating the cursor_sharing = ‘SIMILAR’ setting [ID 1169017.1]

Applies to:
Oracle Server - Enterprise Edition - Version: 11.1.0.6 to 11.2.0.2 - Release: 11.1 to 11.2
Information in this document applies to any platform.

What is being announced?

We recommend that customers discontinue setting cursor_sharing = SIMILAR due to the many problematic situations customers have experienced using it. The ability to set this will be removed in version 12 of the Oracle Database (the settings of EXACT and FORCE will remain available). Instead, we recommend the use of Adaptive Cursor Sharing in 11g.

A number of customers have seen an increase in the number of child cursors since migrating to Oracle Database 11g Release 2. This can lead to many problems including complete CPU saturation of a machine requiring a database instance bounce or general database performance issues in the form. of waits on mutexes and 'library cache lock'.

From Oracle versions 9.0 through 11.1, an oracle instance would limit the number child cursors in the shared pool associated with a single parent to 1024 before it would mark the parent OBSOLETE effectively invalidating it and all the children. Then a new parent with one child would be created and used going forward. But this would only limit the degradation of performance for some environments rather than fix something that could be addressed more effectively through improved application coding. (The attempt to address this from the database side also introduced other issues like bug 5177766). The child limit was removed by Oracle development because it was only masking an application problem at the expense of database performance for better designed applications. In addition, the obsolete code would not work in cases when SQL was wrapped within PL/SQL. The fundamental problem that obsolete code was masking is application code that was written incorrectly with regards to the ability to be shared. For example,  it is not written with user binds or the literal characteristics differ to a high degree.

Therefore, setting cursor_sharing = SIMILAR is highly discouraged in Oracle Database 11g Release 2 (and generally has not been recommended for most environments even in earlier versions) for several reasons:

1) This parameter is generally overly restrictive in what it actually allows to be shared. SIMILAR tells oracle to try and share cursors by replacing all literals with binds for legacy applications, but directs that sharing only be performed when all the replaced literal values were exactly the same (in the case of predicates referencing columns with histograms or using inequality operators such as BETWEEN, 2) This parameter seems to bypass a lot of the improvements made with Oracle Database 11g’s Adaptive Cursor Sharing feature and other abilities in the Cost Based Optimizer code to make better decisions on what execution plans should and should not be shared.
3) Having many child cursors all associated with 1 parent cursor could perform. much worse than having many parent cursors that would be seen with having the default setting of cursor_sharing = EXACT (or FORCE). The scenario of many thousands of child cursors associated with 1 parent results in a potential bottleneck for searches for matching cursors (soft parsing) within the library cache.

The cursor_sharing parameter was introduced as a workaround for legacy applications that could not scale because they had not yet been redesigned to use bind variables. It has been presumed that most applications have been redesigned since then. If you are still using such an application, our recommendation is to set cursor_sharing = FORCE. This setting maximizes cursor sharing while leveraging the Adaptive Cursor Sharing framework to generate multiple execution plans based on different literal value ranges if necessary.
What do you need to do?

Change the cursor_sharing to either FORCE or EXACT, keeping in mind the effects of either.

----KUMAS  ORACLE DOCUMENT

时间: 2024-10-23 18:23:24

ANNOUNCEMENT: Deprecating the cursor_sharing = ‘SIMILAR’的相关文章

[20120421] cursor_sharing=similar和子光标问题.txt

[20120421] cursor_sharing=similar和子光标问题.txt 如果设置cursor_sharing=similar如果存在直方图会产生大量子光标,11GR2的新特性ACS可以很好的解决问题.自己做一些测试说明cursor_sharing=similar产生大量子光标的问题. SQL> select * from v$version; BANNER --------------------------------------------------------------

[20140802]cursor_sharing=similar.txt

[20140802]cursor_sharing=similar.txt --晚上看了http://www.dbaxiaoyu.com/archives/2248,在 cursor_sharing='similar'的情况下,会出现N多子光标(如果查询字段有直方 --图的情况下).实际上oracle在以后的版本会淘汰调cursor_sharing=similar的情况. SCOTT@test01p> @ver BANNER                                     

关于cursor_sharing=similar

关于cursor_sharing=similar 2009-02-12 09:41 biti_rainy关于cursor_sharing=similar 我们先看看在表没有分析无统计数据情况下的表现 SQL>[color=red] alter session set cursor_sharing = similar; [/color] Session altered. SQL> select name,value from v$sysstat where name like '%parse%'

[转载】——故障排除:Shared Pool优化和Library Cache Latch冲突优化 (文档 ID 1523934.1)

原文链接:https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=23w4l35u5_4&id=1523934.1用途   提出问题,得到帮助并分享您的心得   排错步骤   什么是shared pool?   专用术语   Literal SQL   Hard Parse(硬解析)   Soft Parse(软解析)   完全相同的语句?   Sharable SQL   语句的版本   Library Cac

【每日一摩斯】-Shared Pool优化和Library Cache Latch冲突优化 (1523934.1)-系列4

CURSOR_SHARING 参数 (8.1.6 以上)        这个参数需要小心使用.如果它被设为FORCE,那么Oracle会尽可能用系统产生的绑定变量来替换原来SQL中的literals部分.对于很多仅仅是literal不一样的相似的语句,这会让它们共享cursor.这个参数可以在系统级别或者session级别动态设置: ALTER SESSION SET cursor_sharing = FORCE; 或者 ALTER SYSTEM SET cursor_sharing = FOR

cursor_sharing设置为similar 的弊端

将cursor_sharing设置为similar会产生许多问题:1.对于语句中包含的范围查询(如between, <, !=)或者所捆绑的列中进行直方图统计不适合使用:2.影响11g Adaptive Cursor sharing特性和CBO优化器3.Similar可能产生的一个父游标, 多个子游标,其性能比多个父游标情况更加糟糕(EXACT或 FORCE); 对于第一个,我们做实验如下: 1 修改参数,建表,统计信息 yang@rac1>alter session set cursor_s

由cursor_sharing=force导致的ora-600错误

1.在alert_lxdb.log日志中报600错误 Errors in file /u01/app/oracle/admin/lxdb/udump/lxdb_ora_50379.trc: ORA-00600: internal error code, arguments: [kkslhsh1], [101], [], [], [], [], [], [] 注意这个问题可能会导致产生非常大的trc 文件而导致 文件系统满! 2.本问题的产生根本原因: 设置了 cursor_sharing = f

Oracle: 变量绑定

Parent-Child cursor (父子游标) 父游标:只要SQL语句文本相同,它们就对应 同一个parent cursor. 子游标:在某些情况下,虽然SQL语句的文本相同,但是因为其它 因素不同(这些因素可以在视图V$SQL_SHARED_CURSOR中查看),导致产生不同的child cursor.(重新生成child cursor,也就意味着一次硬解析) cursor_sharing 对 于是否使用绑定变量这个问题,最好是交给应用程序决定,在数据库层面是很难正确判断. (这也是为什

11.2.0.3 Patch Set - Availability and Known Issues [ID 1348336.1]

11.2.0.3 Patch Set - Availability and Known Issues [ID 1348336.1] To Bottom Modified:16-Jan-2013Type:READMEStatus:PUBLISHEDPriority:3 Comments (0) Known Issues specific to the 11.2.0.3 Patch Set Please note that 11.2 Patch Sets 11.2.0.2 and higher ar