session_cached_cursors,cursor_space_for_time
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部落格 ” ,連結:http://blog.itpub.net/9533994/viewspace-1020432/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- session_cached_cursorsSession
- SESSION_CACHED_CURSORS詳解Session
- 引數SESSION_CACHED_CURSORSSession
- session_cached_cursors的研究Session
- open_cursors與session_cached_cursorsSession
- open_cursor session_cached_cursors 優化Session優化
- 多版本cursor,與session_cached_cursors關係Session
- Execute to Parse% 及open_cursors,session_cached_cursorsSession
- 受困於一個引數:session_cached_cursorsSession
- 引數session_cached_cursors的詳細解釋(zt)Session
- 引數 session_cached_cursors 與 open_cursors詳解Session
- Awr和statspack中的execute to parse和session_cached_cursorsSession
- 共享池之九:繫結變數與session_cached_cursors變數Session
- 修改open_cursors和session_cached_cursors的引數值Session
- Oracle 11gR2 調整session_cached_cursors引數OracleSession
- [20201116]測試CURSOR_SPACE_FOR_TIME=false(11g).txtFalse
- 引數session_cached_cursors的工作原理及優缺點分析Session
- v$sqlarea_parse_calls與executions與session_cached_cursors關係SQLSession
- 9i資料庫下修改session_cached_cursors引數資料庫Session
- 關於open_cursors和session_cached_cursors的引數值Session
- 【最佳化】引數SESSION_CACHED_CURSORS與解析之間的關係Session
- 正確設定open_cursors和'session_cached_cursors' 可以減少sql解析SessionSQL
- [20180822]session_cached_cursors與子游標堆0.txtSession