Oracle記憶體中的幾個重要監控指標
最近在研究一些監控oracle資料庫效能指標的引數,幾個重要的命中率描述如下:
1.Library Cache Hit Ratio
Library Cache Hit Ratio = sum(pinhits) / sum(pins)
note:
pinhits:The number of times all of the metadata pieces of the library object were found in memory
pins:The number of times a PIN was requested for objects of this namespace
2.Dictionary Cache Hit Ratio
SELECT parameter , sum(gets) , sum(getmisses) , 100*sum(gets - getmisses) / sum(gets) pct_succ_gets, sum(modifications) updates
FROM V$ROWCACHE
WHERE gets > 0
GROUP BY parameter;
total:
SELECT (SUM(GETS - GETMISSES - FIXED)) / SUM(GETS) "ROW CACHE" FROM V$ROWCACHE;
note:
gets:Shows the total number of requests for information on the corresponding item. For example, in the row that contains
statistics for file descriptions, this column has the total number
of requests for file description data.
getmisses:Shows the number of data requests which were not satisfied by the cache, requiring an I/O.
FIXED:Number of fixed entries in the cache
3.Buffer Pool Hit Ratios
SELECT NAME, PHYSICAL_READS, DB_BLOCK_GETS, CONSISTENT_GETS,
1 - (PHYSICAL_READS / (DB_BLOCK_GETS + CONSISTENT_GETS)) "Hit Ratio"
FROM V$BUFFER_POOL_STATISTICS;
NOTE:
PHYSICAL_READS:Physical reads statistic
DB_BLOCK_GETS:Database blocks gotten statistic
CONSISTENT_GETS:Consistent gets statistic
4.表空間碎片程度
由於自由空間碎片是由幾部分組成,如範圍數量、最大範圍尺寸等,我們可用 FSFI--Free Space Fragmentation Index (自由空間碎片索引)值來直觀體現:
FSFI=100*SQRT(max(extent)/sum(extents))*1/SQRT(SQRT(count(extents)))
可以看出, FSFI 的最大可能值為 100 (一個理想的單檔案表空間)。隨著範圍的增加, FSFI 值緩慢下降,而隨著最大範圍尺寸的減少, FSFI 值會迅速下降。
下面的指令碼可以用來計算 FSFI 值:
select tablespace_name,sqrt(max(blocks)/sum(blocks))* (100/sqrt(sqrt(count(blocks)))) FSFI
from dba_free_space
group by tablespace_name order by 1;
碎片程度
select tablespace_name,count(tablespace_name) from dba_free_space group by tablespace_name
having count(tablespace_name)>10;
alter tablespace name coalesce;
alter table name deallocate unused;
create or replace view ts_blocks_v as
select tablespace_name,block_id,bytes,blocks,'free space' segment_name from dba_free_space
union all
select tablespace_name,block_id,bytes,blocks,segment_name from dba_extents;
select * from ts_blocks_v;
select tablespace_name,sum(bytes),max(bytes),count(block_id) from dba_free_space
group by tablespace_name;
檢視碎片程度高的表
SELECT segment_name table_name , COUNT(*) extents
FROM dba_segments WHERE owner NOT IN ('SYS', 'SYSTEM') GROUP BY segment_name
HAVING COUNT(*) = (SELECT MAX( COUNT(*) ) FROM dba_segments GROUP BY segment_name);
5.查回滾段的基本資訊
select segment_name,
to_char(initial_extent) initial_extent,next_extent,
to_char(min_extents) min_extents,owner,
to_char(pct_increase) pct_increase,
dba_rollback_segs.status status,optsize
from dba_rollback_segs,v$rollstat
where dba_rollback_segs.segment_id=v$rollstat.usn;
查回滾段的使用率
select n.name,s.usn,s.wraps, decode(s.waits,0,1,1-s.waits/s.gets) "RBS header get ratio"
from v$rollstat s,v$rollname n
where s.usn=n.usn;
參考文獻:
B14211-03
Performance Tuning Guide
10g Release 2 (10.2)
http://hi.baidu.com/wanhh/blog/item/ebb1202a4f57da3a5343c18b.html
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9252210/viewspace-604135/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 從幾個指標談windows記憶體指標Windows記憶體
- 幾個重要的指令碼來監控Oracle資料庫指令碼Oracle資料庫
- AIX 記憶體監控AI記憶體
- Solaris記憶體監控記憶體
- 記憶體CPU監控記憶體
- mongodb 監控指標MongoDB指標
- EMQ 監控指標MQ指標
- Orabbix監控指標指標
- C指標與記憶體指標記憶體
- Delphi 記憶體與指標記憶體指標
- iOS微信記憶體監控iOS記憶體
- RabbitMQ - 記憶體磁碟監控MQ記憶體
- Solaris記憶體監控(轉)記憶體
- C++中的動態記憶體與智慧指標C++記憶體指標
- Oracle資料庫記憶體監控及意義Oracle資料庫記憶體
- Java程式監控指標Java指標
- 監控innodb status指標指標
- mysql效能監控指標MySql指標
- 遊戲分析中的重要指標遊戲指標
- 衡量記憶體閒忙程度的指標記憶體指標
- 指標:存放記憶體地址的變數指標記憶體變數
- Flutter 上的記憶體洩漏監控Flutter記憶體
- AIX下記憶體洩漏的監控AI記憶體
- oracle11g中的幾個記憶體初始化引數Oracle記憶體
- CPU使用率的幾個重要指標含義列舉指標
- 函式中的指標分配的記憶體怎麼釋放函式指標記憶體
- 淺談Orabbix監控指標指標
- oracle實驗記錄 關於記憶體的幾個viewOracle記憶體View
- nagios-新增記憶體監控iOS記憶體
- 瀏覽器performance工具介紹及記憶體問題表現與監控記憶體的幾種方式瀏覽器ORM記憶體
- 關於 OneAPM Cloud Test DNS 監控的幾個重要問題CloudDNS
- nagios監控linux主機監控記憶體指令碼iOSLinux記憶體指令碼
- 系統監控&JVM監控指標資料查詢JVM指標
- 微服務:指標和健康監控微服務指標
- 運維監控指標彙總運維指標
- MYSQL和SQLServer效能監控指標MySqlServer指標
- 生產經營監控系統指標體系的梳理指標
- C++ 指標動態記憶體分配C++指標記憶體