oracle performance tunning(4)
四、診斷latch競爭
1、概念
Latch是簡單的、低層次的序列化技術,用以保護SGA中的共享資料結構,比如併發使用者列表和 buffer cache裡的blocks資訊。一個伺服器程式或後臺程式在開始操作或尋找一個共享資料結構之前必須獲得對應的latch,在完成以後釋放latch。 不必對latch本身進行最佳化,如果latch存在競爭,表明SGA的一部分正在經歷不正常的資源使用。
1)Latch的作用:
A、序列化訪問:保護SGA中的共享資料結構;保護共享記憶體的分配。
B、序列化執行:避免同時執行某些關鍵程式碼;避免互相干擾。
2)Latch請求的兩種型別:
A、willing-to-wait:請求的程式經過短時間的等待後再次發出請求,直到獲得latch
B、immediate:如果沒有獲得latch,請求的程式不等待,而是繼續處理其他指令。
2、檢查Latch競爭
檢查latch free是不是主要的wait event:
Select * from v$system_event order by time_waited;
檢查latch的使用情況:
Select * from v$latch:
與willing-to-wait請求有關的列:gets、misses、sleeps、wait_time、cwait_time、spin_gets
與immediate請求有關的列:immediate_gets、immediate_misses
Gets: number of successful willing-to-wait requests for a latch;
Misses: number of times an initial wiling-to-wait request was unsuccessful;
Sleeps: number of times a process waited after an initial willing-to-wait request;
Wait_time: number of milliseconds waited after willing-to-wait request;
Cwait_time: a measure of the cumulative wait time including the time spent spinning and sleeping,the overhead of context switches due to OS time slicing and page faults and interrupts;
Spin_gets: gets that misses first try but succeed after spinning.
Immediate_gets: number of successful immediate requests for each latch;
Immediate_misss: number of unsuccessful immediate requests for each latch;
一般無需調整latch,但是下列的措施是有用的:
A、對處於競爭中的latch做進一步的調查
B、如果競爭主要存在於shared pool和library cache中,可以考慮調整應用
C、如果進一步的調查顯示需要調整shared pool和buffer cache,就進行調整
Select * from v$latch where name like ‘%shared pool%’ or name like ‘%library cache%’;
如果競爭是在shared pool或library cache上,表示下列集中情況:
A、不能共享的sql,應檢查他們是否相似,考慮以變數代替sql中的常量:
Select sql_text from v$sqlarea where executions=1 order by upper(sql_text);
B、共享sql被重新編譯,考慮library cache的大小是否需要調整:
SELECT sql_text,parse_calls,executions FROM v$sqlarea where parse_calls>5;
C、library cache不夠大。[@more@]
1、概念
Latch是簡單的、低層次的序列化技術,用以保護SGA中的共享資料結構,比如併發使用者列表和 buffer cache裡的blocks資訊。一個伺服器程式或後臺程式在開始操作或尋找一個共享資料結構之前必須獲得對應的latch,在完成以後釋放latch。 不必對latch本身進行最佳化,如果latch存在競爭,表明SGA的一部分正在經歷不正常的資源使用。
1)Latch的作用:
A、序列化訪問:保護SGA中的共享資料結構;保護共享記憶體的分配。
B、序列化執行:避免同時執行某些關鍵程式碼;避免互相干擾。
2)Latch請求的兩種型別:
A、willing-to-wait:請求的程式經過短時間的等待後再次發出請求,直到獲得latch
B、immediate:如果沒有獲得latch,請求的程式不等待,而是繼續處理其他指令。
2、檢查Latch競爭
檢查latch free是不是主要的wait event:
Select * from v$system_event order by time_waited;
檢查latch的使用情況:
Select * from v$latch:
與willing-to-wait請求有關的列:gets、misses、sleeps、wait_time、cwait_time、spin_gets
與immediate請求有關的列:immediate_gets、immediate_misses
Gets: number of successful willing-to-wait requests for a latch;
Misses: number of times an initial wiling-to-wait request was unsuccessful;
Sleeps: number of times a process waited after an initial willing-to-wait request;
Wait_time: number of milliseconds waited after willing-to-wait request;
Cwait_time: a measure of the cumulative wait time including the time spent spinning and sleeping,the overhead of context switches due to OS time slicing and page faults and interrupts;
Spin_gets: gets that misses first try but succeed after spinning.
Immediate_gets: number of successful immediate requests for each latch;
Immediate_misss: number of unsuccessful immediate requests for each latch;
一般無需調整latch,但是下列的措施是有用的:
A、對處於競爭中的latch做進一步的調查
B、如果競爭主要存在於shared pool和library cache中,可以考慮調整應用
C、如果進一步的調查顯示需要調整shared pool和buffer cache,就進行調整
Select * from v$latch where name like ‘%shared pool%’ or name like ‘%library cache%’;
如果競爭是在shared pool或library cache上,表示下列集中情況:
A、不能共享的sql,應檢查他們是否相似,考慮以變數代替sql中的常量:
Select sql_text from v$sqlarea where executions=1 order by upper(sql_text);
B、共享sql被重新編譯,考慮library cache的大小是否需要調整:
SELECT sql_text,parse_calls,executions FROM v$sqlarea where parse_calls>5;
C、library cache不夠大。[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18921899/viewspace-1016897/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle.Performance.Tuning筆記OracleORM筆記
- Oracle Advanced Performance Tuning Scripts(轉)OracleORM
- 關閉sql tunningSQL
- Oracle Performance Tuning 11g2 (2)OracleORM
- Oracle 19c Concepts(06):Data Dictionary and Dynamic Performance ViewsOracleORMView
- PerformanceORM
- MySQL Performance SchemaMySqlORM
- oracle 4--角色Oracle
- webpack Performance: The Comprehensive GuideWebORMGUIIDE
- Performance Without the Event LoopORMOOP
- 設定performance模式ORM模式
- Boost UDP Transaction PerformanceUDPORM
- [譯] Performance testing of Flutter appsORMFlutterAPP
- 1383. Maximum Performance of a TeamORM
- Performance and High-Availability OptionsORMAI
- Performance --- 前端效能監控ORM前端
- Guideline 2.3.10 - Performance - Accurate MetadataGUIIDEORM
- MySQL Performance Schema詳解MySqlORM
- oracle-listener 4GOracle
- chrome devtools使用詳解——PerformanceChromedevORM
- performance_schema詳解一ORM
- [Javascript] Using IIFE to improve code performanceJavaScriptORM
- 【XTTS】Oracle XTTS V4--Oracle11.2.0.4+ 遷移升級TTSOracle
- 解密Prompt系列1. Tunning-Free Prompt:GPT2 & GPT3 & LAMA & AutoPrompt解密GPT
- 效能優化篇 - Performance(工具 & api)優化ORMAPI
- An Overview of High Performance Computing and Responsibly Reckless AlgorithmsViewORMGo
- Performance API不完全使用指北ORMAPI
- 使用window.performance分析頁面效能ORM
- godaddy 的 Monitoring performance to make your website fasterGoORMWebAST
- MySQL5.6 PERFORMANCE_SCHEMA 說明MySqlORM
- 前端效能監控-window.performance(轉)前端ORM
- Dynamics CRM Performance Issue when CRM Forms OpeningORM
- improve spring integration read message performance from mqSpringORMMQ
- 前端效能監測,Runtime Performance Debug 技巧前端ORM
- 2022 Flutter Performance 效能除錯工具 devToolsFlutterORM除錯dev
- Oracle redo解析之-4、rowid的計算Oracle Redo
- Oracle 20C Concepts(Part V-4)Oracle
- .NET Core 效能分析: xUnit.Performance 簡介ORM
- MySQL調優效能監控之performance schemaMySqlORM