WARNING: Heavy swapping observed on system in last 5 mins.

urgel_babay發表於2016-02-29

2014.11.17

    在檢查一個測試環境看到下面的告警資訊;
WARNING: Heavy swapping observed on system in last 5 mins.
pct of memory swapped in [7.35%] pct of memory swapped out [3.30%].
Please make sure there is no memory pressure and the SGA and PGA
are configured correctly. Look at DBRM trace file for more details.
Mon Nov 17 00:35:56 2014
WARNING: Heavy swapping observed on system in last 5 mins.
pct of memory swapped in [35.11%] pct of memory swapped out [8.77%].
Please make sure there is no memory pressure and the SGA and PGA
are configured correctly. Look at DBRM trace file for more details.
Mon Nov 17 01:35:59 2014
WARNING: Heavy swapping observed on system in last 5 mins.
pct of memory swapped in [2.83%] pct of memory swapped out [0.00%].
Please make sure there is no memory pressure and the SGA and PGA
are configured correctly. Look at DBRM trace file for more details.

在11gR2中DBRM(database resource manager,11gR2中新的後臺程式,會在Alert.log告警日誌中反映OS作業系統最近5分鐘是否有劇烈的swap活動了。

可以看到dbrm收集到了短期內的swapin和swapout資料,這樣便於我們診斷由swap造成的效能或者hang問題。
matelink上面相關的文章擷取:

Fix

The reason you may now see these informational messages in the alert is due to the fact that in 11.2.0.3 an enhancement fix was included for unpublished
Bug 10220118 - Print warning to alert log when system is swapping (Doc ID 10220118.8)

Please refer to
Note 10220118.8 - Bug 10220118 - Print warning to alert log when system is swapping

Description
  This fix is really an enhancement.
  With this fix a warning is printed to the alert log (and DBRM trace)
  if excessive swapping is observed on the system.
  The warning will not be printed more than once per hour.
  
The same issues could have been happening on 11.2.0.2 but they simply would not have been reported.
There is no cause for concern and we suggest that the databases are just monitored as usual.
If you look in the alert log, you will see that the message does not happen every hour. 
If SWAP was causing any serious issue we could also see ORA-4031/ORA-4030 and would then be able to use the DBRM trace in conjunction with obtaining further diagnostics.

     上面的方法就是打補丁或做升級。但是具體問題還是得具體解決,要結合自己的情況。

     我的庫的版本是: 11.2.0.4.0已經高於上面所說的,所以可以排除升級或打補丁操作。
透過對自己庫的瞭解,我認為我的不需要打補丁或者升級。

而是加大記憶體或者調小sag+pga。我之前實驗過,加大這個測試環境的記憶體,確實可以避免這個。

總結一點解決OS 系統嚴重swap的一些出發點:

1.  診斷是否存在記憶體洩露的程式,解決記憶體洩露
2.  調優SGA/PGA ,減少oracle對記憶體的佔用
3.  暫時釋放一些cache的記憶體
4. 加大系統記憶體
5. 調整系統VM記憶體管理引數, 例如Linux上sysctl.conf中的以下幾個引數

設定以下值,減少out of memory的可能性:

# Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
vm.min_free_kbytes = 51200
#vm.swappiness = 40
vm.vfs_cache_pressure = 200


 

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

相關文章