ITPub博客

首页 > 应用开发 > IT综合 > session_cached_cursors,cursor_space_for_time

session_cached_cursors,cursor_space_for_time

原创 IT综合 作者:jlttt 时间:2009-04-13 16:02:47 0 删除 编辑

http://blog.chinaunix.net/u/3380/showart_190946.html

session_cached_cursors:
设置pga端的cache list的长度,当session_cached_cursors设置为0时,pga的cache list长度为0,这时候当sga中的cursor关闭的时候它相关的library cache handle的lock位被清0,从v$open_cursor里看不到这个被关闭的cursor,它服从于shared pool的lru机制,当shared pool需要新的buffer空间时,它将会被flush出shared pool。当session_cached_cursors设置为非0值时,pga的cache list长度为session_cached_cursors值的大小,同时pga cache list将会保留一份拷贝,这时候即使sga中的cursor关闭的时候它相关的library cache handle始终被加了null mode lock,当shared pool空间紧张时library cache handle始终将会被保留在shared pool中.而新的应用访问这个cursor的时候会直接去自己的pga cache list里面搜索。
cursor_space_for_time:
当设置了session_cached_cursors为非0值后,如果cursor_space_for_time值被设为false,那么当shared pool空间紧张时,虽然library cache handle不会被flush出去,但是它指向的library cached object(lco,其中包含了handle和children handle的地址,权限,类型,状态,指向kgl block的指针,其中kgl block包含了真正的代码段和执行计划等内容)将会被flush出去而不管它相关的cursor有没关闭,如果需要lco的时候将要reloads。
如果cursor_space_for_time值被设为true,那么当cursor在打开状态下,handle指向的lco将不会被flush出shared pool,这样就可以降低reloads出现的频率。不过对于sql共享做的不好的数据库,设置
cursor_space_for_time将会带来一些问题,share pool可能会出现04031的错误。

gets:
当试图parse一句sql时,oracle要先获得一个handle,在handle上加载一个lock,gets表示handle request times。
pin:
当获得handle后,定位到lco,然后pin住lco使它在被执行的时候不被flush出去。

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9533994/viewspace-1020432/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Parallel 并行技术
下一篇: 直接路径插入
请登录后发表评论 登录
全部评论

注册时间:2008-06-28

  • 博文量
    75
  • 访问量
    686123