Oracle RAC 的監控和調整 (zt)

tolywang發表於2007-10-20
建立RAC的檢視
$ORACLE_HOME/rdbms/admin/catclust.sql
statspack報告裡關於Cluster的統計:
1、GCS的工作負荷的特性
2、GES的統計資訊
3、GCS和GES的資訊統計
4、GES的詳細統計


Select name,value from v$sysstat where name like ‘%global cache%’;

Global Cache Service Request Latency
在一個完整Block請求中計算平臺延時的公式(百分之一秒)
Global Cache CR Block Receive Time
Local Cache CR Blocks Received

1、Global Cache Service請求的延時,構成一個完整讀塊的平均時間:
a = (global cache cr block build time) / (global cache cr blocks served)
2、等待Log Flush的平均時間
b = (global cache cr block flush time) / (global cache cr blocks served)
3、傳送完整塊的平均時間
c = (global cache cr block send time) / (global cache cr blocks served)
4、平均的lms服務時間
平均的延時 - a – b – c
5、監控當前的塊的處理
當前的快的平均延時 = (global cache current block receive time / global cache current blocks received ) –( global cache current block pin time + global cache current block flush time + global cache current block send time ) / (global cache current blocks served)
如果值比較高,有可能在Buffers、cpu cycles、interconnect訪問有可能競爭
6、監控block模式的轉換
平均轉換時間(毫秒) = 10 * (global cache convert time) / (global cache converts)
平均get時間(毫秒) = 10 * (global cache get time) / (global cache gets)
下面的統計計算了超時global cache convert timeouts,分析global enqueue統計
1. 收集global統計資料
a) 監控statspack ges統計部分
b) 查v$sysstat
2. 計算平均global enqueue時間
3. 計算平均global鎖轉換時間
4. 確定可能導致檔案的資源型別
5. 使用v$librarycache 和v$rowcache檢視來進行進一步的分析

select name, value from v$sysstat where name like ‘%global lock%’;

計算平均global enqueue時間(毫秒)
10 * (global lock get time) / (global lock sync gets + global lock async gets)

計算平均global lock convert時間(毫秒)
10 * (global lock convert time) / (global lock sync converts + global lock async converts)

select event,time_waited,average_wait from v$system_event order by time_waited desc;

select namespace, dlm_lock_request, dlm_pin,requests, dlm_pin_releasees, dlm_invalidation_requests, dlm_invalidations from v$librarycache;
select parameter, dlm_requests, dlm_conflicts, dlm_releasees from v$rowcache;

監控global enqueue 服務資源統計
1、加入統計
EVENT = ” 29700 TRACE NAME CONTEXT FOREVER”
2、查統計結果
v$ges_convert_local
v$ges_convert_remote

分析global enqueue服務資源統計
select r.convert_type, r.average_convert_time, l.average_convert_time, r.convert_count, l.convert_count from v$ges_convert_local l, v$ges_convert_remote r where r.convert_count <> 0 or l.convert_count <>0 group by r.convert_type;

其它的檢視來查詢資源活動
v$lock_activity
v$class_cache_transfer
v$cache_transfer
v$file_cache_transfer
V$system_evnet
事務的響應時間
response time/number of transaction = cpu time /number of transactions + wait time /number of transactions

RAC在v$system_evnet中的事件
Global cache cr request
Library cache pin
Buffer busy due to global cache
Global cache busy
Global cache open x
Global cache open s
Global cache null to x
Global cache s to x
Global cache null to s

調整例項之間效能的觀察
select paramater, count, dlm_requests, dlm_conflicts, dlm_releasees from v$rowcache;

select namespace, dlm_lock_requests, dlm_pin_requests, dlm_pin_releases, dlm_invalidation_requests, dlm_invalidations from v$librarycache;

調優戰略
收集基線資料
監控統計跟基線資料進行比較
只有在效能降低到不可以接受的水平才去調優
要監控跟cluster db無關的因素
address causes為更高水平的競爭

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-84963/,如需轉載,請註明出處,否則將追究法律責任。

相關文章