Oracle 客户端和 ODAC 之间的区别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29268299/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 00:49:28  来源:igfitidea点击:

Difference between Oracle Client and ODAC

oracleodac

提问by Vince Miccio

What is the difference between installing the full Oracle Client and an Oracle Odac install? Which will I need to do .NET development on my dev workstation and which will I need on the web application server that will connect with the Oracle database on another server?

安装完整的 Oracle 客户端和安装 Oracle Odac 有什么区别?哪些需要在我的开发工作站上进行 .NET 开发,哪些需要在将与另一台服务器上的 Oracle 数据库连接的 Web 应用程序服务器上?

采纳答案by mason

ODAC includes Oracle Data Provider for .NET, Oracle Developer Tools for Visual Studio (ODT), Oracle Providers for ASP.NET, .NET stored procedure support, as well as additional Oracle data access software for Windows.

ODAC 包括适用于 .NET 的 Oracle 数据提供程序、适用于 Visual Studio (ODT) 的 Oracle 开发人员工具、适用于 ASP.NET 的 Oracle Providers、.NET 存储过程支持,以及适用于 Windows 的其他 Oracle 数据访问软件。

-Oracle's site.

-Oracle 的网站

The full Oracle client includes a lot of extra software, for example SQLPlus, SQL Developer etc.

完整的 Oracle 客户端包括许多额外的软件,例如 SQLPlus、SQL Developer 等。

Anyways, that's mostly irrelevant. The standard way of obtaining database drivers in .NET is by using NuGet, and Oracle has an official managed driverwith no outside dependencies that's the simplest way to get started. You add that package via NuGet to your application, and the necessary DLL's will be included with your application when you publish it without needing to specially configure the server.

无论如何,这基本上是无关紧要的。在 .NET 中获取数据库驱动程序的标准方法是使用 NuGet,而 Oracle 有一个没有外部依赖项的官方托管驱动程序,这是最简单的入门方法。您可以通过 NuGet 将该包添加到您的应用程序中,并且在您发布应用程序时,必要的 DLL 将包含在您的应用程序中,而无需专门配置服务器。

回答by piers7

It's pretty confusing, and writing this down again helped me.

这很令人困惑,再次写下来对我有帮助。

My summary:

我的总结:

  • The Oracle Instant Client only exposes direct OCI (Oracle Call Interface) APIs, so only relevant to Oracle-aware applications (see, say, http://www.oracle.com/technetwork/topics/winx64soft-089540.html)
  • ODAC includesthe Instant Client, plus also a bunch of Microsoft-facing APIs on top of that (.net providers, ASP.Net membership provider, OLEDB driver, ODBC driver, MTS transaction coordinator) which cover what you'd need in most Windows application scenarios. eg http://www.oracle.com/technetwork/topics/dotnet/downloads/install112021-200037.html. ODAC comes in two flavours: the 'xcopy' version, and the OUI (Oracle Universal Installer) version (and only the OUI version includes SQL*Plus[#1])
  • ODT (Oracle Developer Tools for .Net) provides the Visual Studio integration, and is normally bundled with ODAC (you get a download called ODTwithODACxxxx.zip) eg http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
  • The Oracle.DataAccessnuget package is a version of the ODAC .net driver, so requiresan existing Instant Client install (ie uses OCI). Confusingly, at one point this was labeled a managed driver (because it is, just has some significantnon-managed local dependencies).
  • The Oracle.ManagedDataAccessnuget package is a fully-managed .net driver that works in 'direct' mode, and needs no local instant client
  • Oracle Instant Client 仅公开直接 OCI(Oracle 调用接口)API,因此仅与支持 Oracle 的应用程序相关(例如,请参见 http://www.oracle.com/technetwork/topics/winx64soft-089540.html
  • ODAC包括Instant Client,此外还有一堆面向 Microsoft 的 API(.net 提供程序、ASP.Net 成员资格提供程序、OLEDB 驱动程序、ODBC 驱动程序、MTS 事务协调器),它们涵盖了您在大多数 Windows 中所需的内容应用场景。例如http://www.oracle.com/technetwork/topics/dotnet/downloads/install112021-200037.html。ODAC 有两种版本:“xcopy”版本和 OUI(Oracle 通用安装程序)版本(只有 OUI 版本包含 SQL*Plus[#1])
  • ODT(用于 .Net 的 Oracle 开发人员工具)提供 Visual Studio 集成,并且通常与 ODAC 捆绑在一起(您可以下载名为 ODTwithODACxxxx.zip 的下载),例如http://www.oracle.com/technetwork/topics/dotnet/utilsoft- 086879.html
  • Oracle.DataAccessNuGet包是ODAC .NET驱动程序的版本,所以需要一个现有的即时客户端安装(即使用OCI)。令人困惑的是,它一度被标记为托管驱动程序(因为它只是具有一些重要的非托管本地依赖项)。
  • Oracle.ManagedDataAccessNuGet包是一个完全托管的.NET驱动程序,在“直接”模式,作品,无需本地即时客户端

So for most .net people, 'Oracle Client' means OUI-installed ODAC Instant Client + .Net drivers, possibly also ODT.

因此,对于大多数 .net 用户来说,“Oracle Client”意味着安装了 OUI 的 ODAC Instant Client + .Net 驱动程序,也可能是 ODT。

For the nugets, it's worth pointing out that even now (Jan 2017) the Oracle.ManagedDataAccess driver still can't do a bunch of stuff[#2], so Oracle.DataAccess + InstantClient is not a totally obsolete option. If you are just reading and writing with SELECT/INSERT, or vanilla ADO.Net you will be fine. I'm told the EF support is much better than it used to be also. DevArt's dotConnect drivers are another (very good) option here.

对于 nugets,值得指出的是,即使是现在(2017 年 1 月),Oracle.ManagedDataAccess 驱动程序仍然不能做很多事情[#2],所以 Oracle.DataAccess + InstantClient 并不是一个完全过时的选择。如果您只是使用 SELECT/INSERT 或 vanilla ADO.Net 进行读写,您会没事的。我听说 EF 支持也比以前好得多。DevArt 的 dotConnect 驱动程序是这里的另一个(非常好的)选择。

There's also a nuget package for the Oracle instant client, but I have no idea what that is for. Presumably Win32/.Net native-OCI apps that want a zero-install Instant Client via nuget. Both of them.

还有一个用于 Oracle 即时客户端的 nuget 包,但我不知道它是做什么用的。大概是希望通过 nuget 零安装即时客户端的 Win32/.Net 本机 OCI 应用程序。两个都。

[#1] SQL*Plus would presumably be little used at runtime, though there is a separate installerlisted on the Instant Client download page if you want to to add it to an existing ODAC install.

[#1] SQL*Plus 在运行时可能很少使用,但如果您想将它添加到现有的 ODAC 安装,Instant Client 下载页面上列出了一个单独的安装程序

[#2] eg: call oracle stored procedures with table-valued UDTs

[#2] 例如:使用表值 UDT 调用 oracle 存储过程