oracle cursor_sharing²ÎÊý
ÏÈÀ´¿´¿´¹Ù·½ÎĵµÖжÔÕâ¸ö²ÎÊýµÄ½âÊÍ
CURSOR_SHARING
PropertyDescription
Parameter type
String
Syntax
CURSOR_SHARING = { SIMILAR | EXACT | FORCE }
Default value
EXACT
Modifiable
ALTER SESSION, ALTER SYSTEM
Basic
No
CURSOR_SHARING determines what kind of SQL statements can share the same cursors.
Values:
FORCE
Forces statements that may differ in some literals, but are otherwise identical, to share a cursor, unless the literals affect the meaning of the statement.
SIMILAR
Causes statements that may differ in some literals, but are otherwise identical, to share a cursor, unless the literals affect either the meaning of the statement or the degree to which the plan is optimized.
EXACT
Only allows statements with identical text to share the same cursor.
================================================================================
²ÎÊýcursor_sharingµÄ½âÊÍ
--------------------------------------
Õâ¸ö²ÎÊýµÄÉèÖã¬oracleÊÇΪÁËÂú×ãһЩÒÔÇ°¿ª·¢µÄ³ÌÐò£¬ÀïÃæÓдóÁ¿µÄsimilar statement£¬µ«ÊÇÖØдÓв»ÏÖʵµÄÇé¿öÏÂʹÓõÄÒ»¸ö²ÎÊý¡£
²¢ÇÒoracleÒ²²»½¨ÒéʹÓÃÕâ¸ö²ÎÊý¡£
ʲôʱºòÐèÒªÐÞ¸ÄÕâ¸ö²ÎÊýÄØ£¿ÐèÒªÂú×ãÒÔϵÄÌõ¼þ¡£
Ò»¸öÊÇÓÉÓÚ´óÁ¿µÄshared pool hit missÓ°ÏìÁËÓû§µÄÏìӦʱ¼ä£¨¾ÍÊǵ±Ç°µÄshared poolÎÞ·¨Âú×ã¹²ÏísqlÓï¾ä´æ´¢µÄÐèÒª,Alan:µ±Ç°libary cacheÖÐûÓÐÎÒÃÇËùÐèÒªÖØÓõÄexplainºÍsql£©£¬Èç¹ûûÓÐÕâ¸öÎÊÌ⣬ÄÇôÉèÖÃÕâ¸ö²ÎÊý£¬¿ÉÄÜ»áÔì³É¸üÔã¸âµÄÐÔÄÜ¡£Õâ¸ö²ÎÊýÖ»»á¼õÉÙparseµÄʱ¼ä¡£
ÁíÍâÒ»¸ö¾ÍÊÇÔÚÏÖÓгÌÐòÖÐÓдóÁ¿µÄsimilar statement£¬¿ÉÒÔͨ¹ýÉèÖÃÕâ¸ö²ÎÊýÀ´»ñµÃ±È½ÏºÃµÄÐÔÄÜ¡£
cursor_sharingÕâ¸ö²ÎÊýÓÐÈý¸öÖµ¿ÉÑ¡£¬exact¡¢similar¡¢force¡£µ±ÖµÎªexactʱΪĬÈÏÖµ£¬Ò²ÊÇoracleµÄĬÈÏ´¦Àí·½Ê½¡£¾ÍÊǵ±Ò»¸östatement parseµÄʱºò£¬Ê×Ïȵ½shared poolÇø²é¿´ÊÇ·ñÓÐexact statement´æÔÚ£¨¾ÍÊÇ¿´ÊÇ·ñÔÚshared poolÖÐÓк͵±Ç°Òª½âÎöµÄstatementÍêÈ«Ò»ÑùµÄÓï¾ä´æÔÚ£©£¬Èç¹û²»´æÔÚ£¬¾ÍÖ´ÐÐhard parse
Èç¹û¸Ã²ÎÊýÉèÖÃΪsimilar£¬ÄÇôÈç¹ûÔÚshared poolÖÐÎÞ·¨ÕÒµ½exact statementµÄ´æÔÚµÄʱºò£¬¾Í»áÔÚshared pool½øÐÐÒ»´ÎеIJéÕÒ£¬¾ÍÊDzéÕҺ͵±Ç°Òª½âÎöµÄÓï¾äÊÇ·ñÊÇsimilar statementµÄÓï¾ä¡£ÕâÀïÐèÒª¶Ôsimilar statement½øÐнâÊÍ£¬simila
Ïà¹ØÎĵµ£º
×î½üÔÚʹÓùý³ÌÖеķ¢ÏÖÁ¬½ÓÊý¾Ý¿âʱºÃʱ»µ£¬¾³£±¨TNSÒì³££¬ÔÚ¿ØÖÆÃæ°åÖÐÔÚ·þÎñÖн«tnsÕý³£Æô¶¯ºó£¬µ±Á¬½ÓÊý¾Ý¿âʱ·¢ÏÖtnsÓÖÍ£Ö¹ÁË¡£¿à¿àÔÚÍøÉÏËÑÑ°ÁËÐí¶à£¬·¢ÏÖÍøÉÏÆÌÌì¸ÇµØµÄÈýÖÖ·½·¨£¬ÎÒÒ»Ò»ÊÔÁ˶¼Ã»ÓÐ×÷Óá£
ºóÀ´ÎÞÒâÖп´µ½Ò»Î»ÍøÓÑ˵Ëû³öÏÖ¹ýÏàͬµÄÎÊÌ⣬ÊÇÓÉÓÚ×°Á˸övpnÈí¼þ£¬ÕâʱµÄÎÒÉñ¾ÌرðÃô ......
ORACLEÖÕÓÚÔÚ10GÖÐÌṩÁ˶ÔÕýÔò±í´ïʽµÄÖ§³Ö£¬ÒÔÇ°ÄÇЩÐèҪͨ¹ýLIKEÀ´½øÐеĸ´ÔÓµÄÆ¥Åä¾Í¿ÉÒÔͨ¹ýʹÓÃÕýÔò±í´ïʽ¸ü¼òµ¥µÄʵÏÖ¡£
Oracle 10gÕýÔò±í´ïʽÌá¸ßÁËSQLÁé»îÐÔ¡£ÓÐЧµÄ½â¾öÁËÊý¾ÝÓÐЧÐÔ£¬ Öظ´´ÊµÄ±æÈÏ, Î޹صĿհ׼ì²â£¬»òÕß·Ö½â¶à¸öÕýÔò×é³ÉµÄ×Ö·û´®µÈÎÊÌâ¡£
Oracle 10gÖ§³ÖÕýÔò±í´ïʽµÄË ......
¡¾×ª¡¿http://topic.csdn.net/t/20031006/10/2327335.html
ÎÄÕÂÀ´×Ô www.ncn.cn (¾ÛÏÍׯ)
=======================================================
ORACLEÀïËøÓÐÒÔϼ¸ÖÖģʽ:
0£ºnone
1£ºnull ¿Õ ......
½ñÌìXXX˵Ҫ°ÑOracle ÀïµÄ¼¸ÕűíÖØÐÂÕûÀíÏ£¬ºÇºÇ ½á¹û°¢·¢ÏÖ10À´ÕÅ±í»¹ÕæÊÇ˵¶à²»¶à˵ÉÙÒ»µã¶¼²»ÉÙ ¡£ÒòΪ±íÀïÃæµÄcommetÒѾÌîÉÏÁË ¡£ÍµÀÁµÄÏë·¨¶Ùʱ³öÏָ¸Â
select t.COLUMN_NAME ×Ö¶ÎÃû, t.DATA_TYPE||'('||t.DATA_LENGTH||')' ×Ö¶ÎÀàÐÍ,t.NULLABLE ÊÇ·ñΪ¿Õ,t.DATA_DEFAULT ĬÈÏÖµ,p.comments ×Ö¶Î˵Ã÷
fro ......
¾ÍÊÇÓÉÆÕͨ×Ö·û£¨ÀýÈç×Ö·ûaµ½z£©ÒÔ¼°ÌØÊâ×Ö·û£¨³ÆΪԪ×Ö·û£©×é³ÉµÄÎÄ×Öģʽ¡£¸ÃģʽÃèÊöÔÚ²éÕÒÎÄ×ÖÖ÷Ìåʱ´ýÆ¥ÅäµÄÒ»¸ö»ò¶à¸ö×Ö·û´®¡£ÕýÔò±í´ïʽ×÷Ϊһ¸öÄ£°å£¬½«Ä³¸ö×Ö·ûģʽÓëËùËÑË÷µÄ×Ö·û´®½øÐÐÆ¥Åä¡£
±¾ÎÄÏêϸµØÁгöÁËÄÜÔÚÕýÔò±í´ïʽÖÐʹÓã¬ÒÔÆ¥ÅäÎı¾µÄ¸÷ÖÖ×Ö·û¡£µ±ÄãÐèÒª½âÊÍÒ»¸öÏÖÓеÄÕýÔò±í´ïʽʱ£¬¿ÉÒÔ×÷Ϊһ¸ö¿ ......