在我的服务器上,我使用 SqlClient 连接到 SQL Server,Oledb 用于连接 Oracle 的旧应用程序和 ODP.NET 用于连接 Oracle 的新应用程序。
我在性能计数器中看到:
但是我只能添加和查看用于 Sql Server 和 ODP.NET 的 .NET 数据提供程序的计数器,而用于 Oracle 的 .NET 数据提供程序(我的意思是
System.Data.Oledb
)不工作。来源:
The OleDb provider does not expose performance counters.
那是对的吗?
最佳答案
The OleDb provider does not expose performance counters.
不幸的是,这是真的 .
但另一方面,您提到的三个提供程序都有性能计数器:
(1,2) Oracle 的 .NET 数据提供程序和 Sql Server 的 .NET 数据提供程序
.NET Data Provider for Oracle不是
System.Data.OLEDB
提供者是 System.Data.OracleClient
Provider,它有性能计数器。基于 Performance Counters in ADO.NET official documentation :
ADO.NET 2.0 introduced expanded support for performance counters that includes support for both System.Data.SqlClient and System.Data.OracleClient.
而在 System.Data.OracleClient Namespace documentation他们提到:
The System.Data.OracleClient namespace is the .NET Framework Data Provider for Oracle.
那么,什么是 System.Data.OLEDB?
引用System.Data.OleDb Namespace official documentation :
The System.Data.OleDb namespace is the.NET Framework Data Provider for OLE DB.
在谈论性能计数器时,Microsoft 似乎没有提到与此 Provider 相关的任何内容。
(3) 用于 .NET 的 Oracle 数据提供程序
引用Data Provider for .NET Developer's Guide :
Installing Oracle Data Provider for .NET creates a set of performance counters on the target system. These performance counters are published by ODP.NET for each ODP.NET client application. These performance counters can be viewed using Windows Performance Monitor (Perfmon).
类似问题链接
关于sql-server - 无法添加 Oracle OLEDB 提供程序的性能计数器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42221681/