首页 > 数据库 > Oracle > SESSION_CACHED_CURSORS的应用
什么是SESSION_CACHED_CURSORS
SESSION_CACHED_CURSORS: If an application repeatedly issues parse calls on the same set of SQL statements, then the reopening of the session cursors can affect system performance. To minimize the impact on performance, session cursors can be stored in a session cursor cache. These cursors are those that have been closed by the application and can be reused.
Oracle checks the library cache to determine whether more than three parse requests have been issued on a given statement. If so, then Oracle assumes that the session cursor associated with the statement should be cached and moves the cursor into the session cursor cache. Subsequent requests to parse that SQL statement by the same session then find the cursor in the session cursor cache.
测试案例:
Below is test case by using java program:
1. SESSION_CACHED_CURSORS =100
点击(此处)折叠或打开
--get open cursor, and only one sql statement
点击(此处)折叠或打开
--parse count (total) is 33, and session cursor cache hits is 29
点击(此处)折叠或打开
2. SESSION_CACHED_CURSORS =0
点击(此处)折叠或打开
--parse count (total) is 38, and session cursor cache hits is 0
点击(此处)折叠或打开
: If an application repeatedly issues parse calls on the same set of SQL statements, then the reopening of the session cursors can affect system performance. To minimize the impact on performance, session cursors can be stored in a session cursor cache. These cursors are those that have been closed by the application and can be reused.
Oracle checks the library cache to determine whether more than three parse requests have been issued on a given statement. If so, then Oracle assumes that the session cursor associated with the statement should be cached and moves the cursor into the session cursor cache. Subsequent requests to parse that SQL statement by the same session then find the cursor in the session cursor cache.
Below is test case by using java program:
1. SESSION_CACHED_CURSORS =100
点击(此处)折叠或打开
点击(此处)折叠或打开
--get open cursor, and only one sql statement
--parse count (total) is 33, and session cursor cache hits is 29
点击(此处)折叠或打开
2. SESSION_CACHED_CURSORS =0
点击(此处)折叠或打开
--parse count (total) is 38, and session cursor cache hits is 0
点击(此处)折叠或打开
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25105315/viewspace-694248/ ,如需转载,请注明出处,否则将追究法律责任。