[Oracle Script] Library Cche Hit Ratio
SELECT TO_CHAR(SYSDATE, 'yyyy/mm/dd hh24:mi:ss') TIME,
SUM(reloads) reloads, round(sum(reloads)/sum(pins),4)*100 "Library Cache Reload Ratio",
SUM(gets) gets, SUM(gethits) gethits, round(sum(gethits)/sum(gets),4)*100 "GetHit Ratio",
SUM(pins) pins,SUM(pinhits) pinhits , round(sum(pinhits)/sum(pins),4)*100 "PinHit Ratio"
FROM v$librarycache;
-----------------------------------------------------------------------------------------------------------------------------------
TIME RELOADS Library Cache Reload Ratio GETS GETHITS GetHit Ratio PINS PINHITS PinHit Ratio
2017/03/02 11:38:12 4050 0.01 8702998 8624844 99.1 47411158 47311059 99.79
GETS 可以理解為某個object解析的時候查詢的次數(解析階段)
GETHITS get命中次數
GETHITRATIO 這個值等於gethits/gets
PINS 某個object 解析過後被執行的次數(發生在執行階段)
PINHITS pin命中次數
PINHITRATIO 這個值等於pinhits/pins
RELOADS 某個object 解析過後被從新載入的次數(需要從新從磁碟讀取object),也就是沒有被快取到library cache中,這個通常由於shared pool 過小
INVALIDATIONS 某個物件無效,通常由於物件定義被更改,需要從新解析
select sum(sharable_mem) from v$db_object_cache; #檢視當前shared pool使用的大小
------------------------------------------------
SUM(SHARABLE_MEM)
406164568
select * from v$sgastat where name='free memory' and pool='shared pool'; #檢視當前剩餘shared pool的大小
-----------------------------------------------------------------------
POOL NAME BYTES
shared pool free memory 511748680
長期執行的資料庫的 library cache hitratio 最好應該在95%以上,sum(reloads)與sum(pins) 的比值應該小於 1%,
如果pinhitratio 小於90%,或者reload ratio 大於1% ,而且shared pool 的free memory 很小或者為0,
那麼可以適當增加shared_pool的大小,檢查應用程式程式碼效率,比如是否使用了繫結變數等等.
當前pinhit ratio 99.79,reloads ratio 0.01, free memory 500多M,夠用.
SUM(reloads) reloads, round(sum(reloads)/sum(pins),4)*100 "Library Cache Reload Ratio",
SUM(gets) gets, SUM(gethits) gethits, round(sum(gethits)/sum(gets),4)*100 "GetHit Ratio",
SUM(pins) pins,SUM(pinhits) pinhits , round(sum(pinhits)/sum(pins),4)*100 "PinHit Ratio"
FROM v$librarycache;
-----------------------------------------------------------------------------------------------------------------------------------
TIME RELOADS Library Cache Reload Ratio GETS GETHITS GetHit Ratio PINS PINHITS PinHit Ratio
2017/03/02 11:38:12 4050 0.01 8702998 8624844 99.1 47411158 47311059 99.79
GETS 可以理解為某個object解析的時候查詢的次數(解析階段)
GETHITS get命中次數
GETHITRATIO 這個值等於gethits/gets
PINS 某個object 解析過後被執行的次數(發生在執行階段)
PINHITS pin命中次數
PINHITRATIO 這個值等於pinhits/pins
RELOADS 某個object 解析過後被從新載入的次數(需要從新從磁碟讀取object),也就是沒有被快取到library cache中,這個通常由於shared pool 過小
INVALIDATIONS 某個物件無效,通常由於物件定義被更改,需要從新解析
select sum(sharable_mem) from v$db_object_cache; #檢視當前shared pool使用的大小
------------------------------------------------
SUM(SHARABLE_MEM)
406164568
select * from v$sgastat where name='free memory' and pool='shared pool'; #檢視當前剩餘shared pool的大小
-----------------------------------------------------------------------
POOL NAME BYTES
shared pool free memory 511748680
長期執行的資料庫的 library cache hitratio 最好應該在95%以上,sum(reloads)與sum(pins) 的比值應該小於 1%,
如果pinhitratio 小於90%,或者reload ratio 大於1% ,而且shared pool 的free memory 很小或者為0,
那麼可以適當增加shared_pool的大小,檢查應用程式程式碼效率,比如是否使用了繫結變數等等.
當前pinhit ratio 99.79,reloads ratio 0.01, free memory 500多M,夠用.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2143823/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Cursor Cache Hit Ratio超過100%
- Oracle Library cacheOracle
- Hacking Hit Tests
- 【SCRIPT】Oracle統計資訊相關SQLOracleSQL
- 【SCRIPT】Oracle表管理段管理常用語句Oracle
- 【ASK_ORACLE】Library Cache概念篇(二)之Library Cache Pin的定義Oracle
- 【SCRIPT】Oracle日常巡檢指令碼通用版Oracle指令碼
- 【ASK_ORACLE】Library cache pin 與 library load lock的關係和區別Oracle
- 【TUNE_ORACLE】等待事件之“library cache lock”Oracle事件
- 【TUNE_ORACLE】等待事件之“library cache pins”Oracle事件
- 【SCRIPT】Oracle資料庫基本資訊收集指令碼Oracle資料庫指令碼
- MetricMeasurement calculates Peak Signal-to-Noise RatioREM
- [20220301]oracle如何定位使用library cache mutex.txtOracleMutex
- [LeetCode] 362. Design Hit CounterLeetCode
- [20220302]oracle如何定位使用library cache mutex 2.txtOracleMutex
- [20220303]oracle如何定位使用library cache mutex 3.txtOracleMutex
- 請說說`<script>`、`<script async>`和`<script defer>`的區別
- Script
- 【ASM_ORACLE】Library Cache最佳化篇(二)Library cache load lock的概念和解決辦法ASMOracle
- 【SCRIPT】Oracle12C日常巡檢指令碼通用版Oracle指令碼
- How to get the description of blast hit using blastdbcmd?AST
- Japanese Cryptocurrency Monacoin Hit by Selfish Mining Attack
- 【SCRIPT】Oracle巡檢報告html格式樣例,帶趨勢圖OracleHTML
- Shell Script
- shell script
- 改進飛碟(Hit UFO)遊戲遊戲
- Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "問題ErrorOracleclient
- SCRIPT】Oracle巡檢報告html格式樣例指令碼,帶趨勢圖OracleHTML指令碼
- library cache pin和library cache lock(一)
- library cache pin和library cache lock (zt)
- library cache pin和library cache lock(二)
- Oracle 11g 密碼延遲認證與 library cache lock 等待Oracle密碼
- boost library
- ORA-15180: could not open dynamic library ASM LibraryASM
- Elasticsearch script sort 排序Elasticsearch排序
- npm script中&&和&NPM
- MySQL Server Startup ScriptMySqlServer
- JavaScript <script>標籤JavaScript
- IDM-Activation-Script