前一篇文章介紹過如何使用效能監視器觀察 SQL Connection Pooling 行為,這篇來說說觀察 ODP.NET Connection Pooling 的做法。

參考資料:

首先說一個容易踩到的陷阱:計數器清單中有個「.NET Data Provider for Oracle」,它指的是已被淘汰的 System.Data.OracleClient,而非 ODP.NET 或 Managed ODP.NET,我一開始搞錯,瞎弄半天才驚覺:

真正對映的效能計數器是「ODP.NET, Unmanaged Driver」或「ODP.NET, Managed Driver」:

ODP.NET 效能計數器需要額外安裝及啟用。Oracle.DataAccess.dll 所在目錄有個 OraProvCfg.exe,可執行 oraprovcfg /action:register /product:odp /component:perfcounter /providerpath:_install_path\Oracle.DataAccess.dll 進行安裝。(Managed ODP.NET 為 /product:odpm)

安裝後,計數器選單便會出現「ODP.NET, Unmanaged Driver」群組,上篇文章用到的 NumberOfFreeConnection、NumberOfPooledConnections 也在其中:

這裡還有個眉角,以上計數器預設並不會啟動,必須修改 Registry 旗標開啟,要全部打開就設 4095:

如此就能觀察 ODP.NET 的 Connection Pool 運作狀況囉~

Tips of how to install and setup ODP.NET peformance counter to monitor connection pooling.


Comments

Be the first to post a comment

Post a comment