Oracle 10 和 Oracle 11 客户端共存

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5277487/
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-18 23:01:34  来源:igfitidea点击:

Oracle 10 and Oracle 11 clients coexistence

asp.netoracleoracle10goracle11gcoexistence

提问by Ewerton

I'am a asp.net web developer.

我是一名 asp.net 网络开发人员。

I have the Oracle Client 11 instaled to test some features (EF support), but my applications must be in Oracle10 because my customer uses it.

我安装了 Oracle Client 11 来测试一些功能(EF 支持),但我的应用程序必须在 Oracle10 中,因为我的客户使用它。

So, if i work in my customer project i need the Oracle10 instaled (to test it in my workstation), and if i want to test the features of Oracle11 i need to install oracle 11.

所以,如果我在我的客户项目中工作,我需要安装 Oracle10(在我的工作站中测试它),如果我想测试 Oracle11 的功能,我需要安装 oracle 11。

My question is: How to coexists Oracle 10 and 11 clients in same workstation.

我的问题是:如何在同一工作站中共存 Oracle 10 和 11 客户端。

In other words, i want to debug and run my asp.net web applications in my own workstation and simply change the web.config to use Oracle10 or Oracle11 client.

换句话说,我想在我自己的工作站上调试和运行我的 asp.net web 应用程序,只需将 web.config 更改为使用 Oracle10 或 Oracle11 客户端。

It is possible?

有可能的?

回答by Justin Cave

As long as you install the two versions of the Oracle client in different Oracle Homes, they should coexist peacefully. There are just a couple of gotchas to be aware of

只要将两个版本的Oracle客户端安装在不同的Oracle Homes中,它们应该可以和平共处。有几个问题需要注意

  1. By default, each Oracle Home will have a separate tnsnames.ora file (and sqlnet.ora file, etc.). That often causes confusion if you've configured a TNS alias in one Oracle Home and not in the other. You can configure your environment to use a single set of TNS configuration files by setting the TNS_ADMIN environment variable to point at the directory that contains the one true source of TNS configuration issues (i.e. set TNS_ADMIN to %Oracle11g_Home%\network\admin to always use the tnsnames.ora file from your 11g Oracle Home).
  2. Some third-party products are not multi-home compliant. If you use something like the legacy Microsoft ODBC Driver for Oracle, for example, it will use whichever version of the Oracle client appears first in your PATH. If you are using Oracle drivers to connect to the database, that shouldn't be an issue. If you do need to switch which is the default Oracle Home, you can either manually edit your PATH or you can fire up the Oracle Universal Installer and under Installed Products | Environment, you can control the order that Oracle Homes appear in the PATH.
  1. 默认情况下,每个 Oracle Home 都会有一个单独的 tnsnames.ora 文件(和 sqlnet.ora 文件等)。如果您在一个 Oracle Home 而不是在另一个中配置了 TNS 别名,这通常会导致混淆。您可以将环境配置为使用一组 TNS 配置文件,方法是将 TNS_ADMIN 环境变量设置为指向包含 TNS 配置问题的一个真正来源的目录(即将 TNS_ADMIN 设置为 %Oracle11g_Home%\network\admin 以始终使用11g Oracle Home 中的 tnsnames.ora 文件)。
  2. 某些第三方产品不符合多户标准。例如,如果您使用旧版 Microsoft ODBC Driver for Oracle 之类的东西,它将使用您的 PATH 中首先出现的 Oracle 客户端版本。如果您使用 Oracle 驱动程序连接到数据库,那应该不是问题。如果您确实需要切换默认的 Oracle 主目录,您可以手动编辑您的 PATH,或者您可以启动 Oracle Universal Installer 并在 Installed Products | 下启动 Oracle Universal Installer。环境,您可以控制 Oracle Homes 在 PATH 中出现的顺序。