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
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
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-680305/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CURSOR_SHARING=SIMILARMILA
- 關於 cursor_sharing = similarMILA
- cursor_sharing=similar深度剖析MILA
- cursor_sharing : exact , force , similarMILA
- 關於cursor_sharing=similarMILA
- 關於cursor_sharing = similar(ZT)MILA
- 關於cursor_sharing = similar (zt)MILA
- cursor_sharing = similar , exact 區別MILA
- cursor_sharing=similar 與 直方圖MILA直方圖
- cursor_sharing設定為similar 的弊端MILA
- Cursor_sharing=SIMILAR取值與直方圖(上)MILA直方圖
- Cursor_sharing=SIMILAR取值與直方圖(下)MILA直方圖
- oracle實驗記錄 (cursor_sharing(2)SIMILAR)OracleMILA
- 有關引數cursor_sharing=similar的測試MILA
- [20140802]cursor_sharing=similar.txtMILA
- Oracle 11g 中 cursor_sharing 設定為SIMILAR 導致的問題OracleMILA
- 10203設定CURSOR_SHARING為SIMILAR導致物化檢視重新整理失敗MILA
- oracle cursor_sharing [轉]Oracle
- oracle引數-cursor_sharingOracle
- 【Leetcode】800. Similar RGB ColorLeetCodeMILA
- AtCoder Beginner Contest 282 G - Similar PermutationMILA
- Oracle 的 cursor_sharing引數Oracle
- LeetCode之Leaf-Similar Trees(Kotlin)LeetCodeMILAKotlin
- NJUST 1746 Similar Number(南京邀請賽 J題)MILA
- 繫結變數和cursor_sharing變數
- cursor_sharing和substr函式索引函式索引
- ORACLE中Cursor_sharing引數詳解Oracle
- 小心設定cursor_sharing=force引數
- 『類自然數教室:1~8』(A similar Natural number classroom:1~8)MILAOOM
- ursor_sharing=SIMILAR 引發大量的 cursor: mutex SMILAMutex
- zt_繫結變數和cursor_sharing變數
- Cursor_sharing,Histogram,Analyze之間的關係Histogram
- cursor_sharing=force導致sql profile部分hint失效SQL
- 補充:小心設定cursor_sharing=force引數
- Cursor_sharing,Histogram,Analyze之間的關係(轉)Histogram
- Oracle一些引數的理解 cursor_sharingOracle
- oracle實驗記錄 (cursor_sharing(1)exact&force)Oracle
- [LeetCode] 1750. Minimum Length of String After Deleting Similar EndsLeetCodeMILA