vb.net System.Data.OracleClient 需要 Oracle 客户端软件版本 8.1.7
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/447983/
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
System.Data.OracleClient requires Oracle client software version 8.1.7
提问by wweicker
I have a web site that I developed on Vista using Vb.net9. It makes a connection to Oracle. for the connection I use System.Data.OracleClient. It works fine on my machine, and our test server, but it does not work on the production server. We installed the Oracle Client 11 on the server. The error is System.Data.OracleClient requires Oracle client software version 8.1.7
我有一个使用 Vb.net9 在 Vista 上开发的网站。它与 Oracle 建立连接。对于连接,我使用 System.Data.OracleClient。它在我的机器和我们的测试服务器上运行良好,但在生产服务器上不起作用。我们在服务器上安装了 Oracle Client 11。错误是 System.Data.OracleClient requires Oracle client software version 8.1.7
We've tried, making a console app that opens the connection, connection runs fine, opens, displays a message and all is well there.
我们已经尝试过,制作一个打开连接的控制台应用程序,连接运行良好,打开,显示一条消息,一切都很好。
Then we make a simple web form, put it in the directory of the program, just a button, opens the connection, try..catch, grabs error, same error.
然后我们做一个简单的web表单,放到程序的目录下,就一个按钮,打开连接,try..catch,抓取错误,同样的错误。
The console app was running under an Administrator, web site running under iwam. Is it possible that iwam has a different path?
控制台应用程序在管理员下运行,网站在 iwam 下运行。iwam 有可能有不同的路径吗?
回答by wweicker
I've run into this error dozens of times:
我遇到过这个错误几十次:
Cause
原因
Security permissions were not properly set when the Oracle client was installed on Windows with NTFS. The result of this is that content of the ORACLE_HOME
directory is not visible to Authenticated Users on the machine; this causes an error while the System.Data.OracleClient
is communicating with the Oracle Connectivity software from ASP.NET using Authenticated User privileges.
在使用 NTFS 的 Windows 上安装 Oracle 客户端时,未正确设置安全权限。这样做的结果是ORACLE_HOME
目录的内容对机器上的 Authenticated Users 不可见;这会在System.Data.OracleClient
使用 Authenticated User 权限从 ASP.NET 与 Oracle Connectivity 软件通信时导致错误。
Solution
解决方案
To fix the problem you have to give the Authenticated Users group privilege to the Oracle Home directory.
要解决此问题,您必须将 Authenticated Users 组权限授予 Oracle 主目录。
- Log on to Windows as a user with Administratorprivileges.
- Start Windows Explorer and navigate to the
ORACLE_HOME
folder. - Choose properties on the
ORACLE_HOME
folder. - Click the Securitytab of the Propertieswindow.
- Click on Authenticated Usersitem in the Namelist.
- Un-check the Read and Executebox in the Permissionslist under the Allowcolumn.
- Re-check the Read and Executebox under the Allowcolumn.
- Click the Advancedbutton and in the Permission Entriesverify that Authenticated Usersare listed with permission: Read & Execute, and Apply To: This folder, subfolders and files. If not, edit that line and make sure that Apply Todrop-down box is set to This folder, subfolders and files. This should already be set properly but it is important that you verify it.
- Click the OK button until you close out all of the security properties windows. The cursor may present the hour glass for a few seconds as it applies the permissions you just changed to all subfolders and files.
- Reboot, to assure that the changes have taken effect.
- 以具有管理员权限的用户身份登录到 Windows 。
- 启动 Windows 资源管理器并导航到该
ORACLE_HOME
文件夹。 - 选择
ORACLE_HOME
文件夹的属性。 - 单击“属性”窗口的“安全”选项卡。
- 单击名称列表中的Authenticated Users项目。
- 在允许列下的权限列表中取消选中读取和执行框。
- 重新选中允许列下的读取和执行框。
- 单击“高级”按钮,并在“权限条目”中验证是否列出了经过身份验证的用户并具有以下权限:读取和执行,并应用到: 此文件夹、子文件夹和文件。如果没有,请编辑该行并确保Apply To下拉框设置为This folder, subfolders and files。这应该已经正确设置,但验证它很重要。
- 单击“确定”按钮,直到关闭所有安全属性窗口。光标可能会显示沙漏几秒钟,因为它会将您刚刚更改的权限应用于所有子文件夹和文件。
- 重新启动,以确保更改已生效。
Try your application again.
再次尝试您的应用程序。
回答by John Palmbach
The author of this post (now deleted post) suggests checking your C:\Windows\System32
folder to make sure that the oci.dll
exists there. Copying in the file from the Oracle home directory solved this problem for me.
这篇文章(现已删除的文章)的作者建议检查您的C:\Windows\System32
文件夹以确保该文件夹oci.dll
存在。从 Oracle 主目录复制文件为我解决了这个问题。
回答by Igal Serban
Update 1:It is possible for different users to have different path. But its not the likely problem here. There is more chance that the user that the iwam user doesn't have permission to the oracle client directory.
更新1:不同的用户可能有不同的路径。但这不是这里可能的问题。iwam 用户对 oracle 客户端目录没有权限的用户的可能性更大。
Update 0:Its suppose to work. Check for environment variable ( That are needed to find the oracle client and tnsnames.ora ). Also, Maybe you have a 32/64 bit issues. Also, consider using the Oracle Data Provider for .NET ( search for odp.net)
更新 0:它假设可以工作。检查环境变量(需要找到 oracle 客户端和 tnsnames.ora )。另外,也许您有 32/64 位问题。另外,考虑使用 Oracle Data Provider for .NET(搜索 odp.net)
回答by Mac
Oracle Client version 11 cannot connect to 8i databases. You will need a client in version 10 at most.
Oracle 客户端版本 11 无法连接到 8i 数据库。您最多需要一个版本 10 的客户端。
回答by David d C e Freitas
For me, the issue was some plugin in my Visual Studio started forcing my application into x64 64bit mode, so the Oracle driver wasn't being found as I had Oracle 32bit installed.
对我来说,问题是我的 Visual Studio 中的一些插件开始强制我的应用程序进入 x64 64 位模式,因此由于我安装了 Oracle 32 位,所以没有找到 Oracle 驱动程序。
So if you are having this issue, try running Visual Studio in safemode (devenv /safemode). I could find that it was looking in SYSWOW64 for the ic.dll file by using the ProcMon app by SysInternals/Microsoft.
因此,如果您遇到此问题,请尝试在安全模式 (devenv /safemode) 下运行 Visual Studio。我发现它通过使用 SysInternals/Microsoft 的 ProcMon 应用程序在 SYSWOW64 中查找 ic.dll 文件。
Update: For me it was the Telerik JustTrace product that was causing the issue, it was probably hooking in and affecting the runtime version somehow to do tracing.
更新:对我来说,是 Telerik JustTrace 产品导致了问题,它可能以某种方式连接并影响运行时版本以进行跟踪。
Update2: It's not just JustTrace causing an issue, JustMock is causing the same processor mode issue. JustMock is easier to fix though: Click JustMock-> Disable Profiler and then my web app's oracle driver runs in the correct CPU mode. This might be fixed by Telerik in the future.
更新 2:不仅仅是 JustTrace 导致了问题,JustMock 也导致了相同的处理器模式问题。不过,JustMock 更容易修复:单击 JustMock-> Disable Profiler,然后我的 Web 应用程序的 oracle 驱动程序以正确的 CPU 模式运行。这可能会在未来由 Telerik 修复。
回答by Carl
When we first moved over to Vista with Oracle 10g, we experienced this issue when we installed the Oracle client on our Vista boxes, even when we were running with admin privileges during install.
当我们第一次使用 Oracle 10g 迁移到 Vista 时,我们在 Vista 机器上安装 Oracle 客户端时遇到了这个问题,即使我们在安装过程中以管理员权限运行。
Oracle brought out a new version of the 10g client (10.2.0.3) that was Vista compatible.
Oracle 推出了与 Vista 兼容的新版本 10g 客户端 (10.2.0.3)。
I do believe that this was after 11g was released, so it is possible that there is a 'Vista compatible' version for 11g also.
我相信这是在 11g 发布之后,所以 11g 也可能有一个“Vista 兼容”版本。
回答by Jeroen Wiert Pluimers
Why not use this: dotConnect for Oracle(formerly known as OraDirect .NET)?
为什么不使用这个:dotConnect for Oracle(以前称为 OraDirect .NET)?
It can be configured to not require an Oracle Client at all.
它可以配置为根本不需要 Oracle 客户端。
We have been using this in both Windows Services and ASP.NET Web Services and it works like a charm.
我们一直在 Windows 服务和 ASP.NET Web 服务中使用它,它的工作原理非常棒。