oracle Win7 64 上的 ORA-12154 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3273148/
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
ORA-12154 error on Win7 64
提问by Simon
Is there any solution for this error on Windows 7 64 bit (because I think it's the main cause) in .NET application? (ASP.MVC2 with EF4)
.NET 应用程序中的 Windows 7 64 位(因为我认为这是主要原因)是否有针对此错误的解决方案?(带有 EF4 的 ASP.MVC2)
I've:
我有:
- Windows 7 64 bit
- Oracle Express 10g (i've tried to install Client 11g, but then, during installation i got another error - Net Configuration Assist~ Error - something about oraclj11 and java)
- 视窗 7 64 位
- Oracle Express 10g(我已经尝试安装 Client 11g,但是在安装过程中我遇到了另一个错误 - Net Configuration Assist~错误 - 关于 oraclj11 和 java)
I've also checked and tried:
我也检查并尝试过:
- tnsnames.ora - everything is all right
- tnsping - was successfull
- sqlnet.ora - NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
- tnsnames.ora - 一切正常
- tnsping - 成功
- sqlnet.ora - NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
I'd like to connect with Oracle DB via ASP application (as above) and I still see this error. .NET cannot see alias which is in tnsnames.ora
我想通过 ASP 应用程序(如上)连接 Oracle DB,但我仍然看到此错误。.NET 看不到 tnsnames.ora 中的别名
回答by Simon
Error:ORC-12154 and Oracle Provider not compatible with current OS (povider 32 bit, OS 64)
错误:ORC-12154 和 Oracle Provider 与当前操作系统不兼容(povider 32 位,OS 64)
OS:Windows 7 64-bit, .NET 4.0, Visual Studio 2010, Tunel via SSH (putty)
操作系统:Windows 7 64 位、.NET 4.0、Visual Studio 2010、通过 SSH 的 Tunel(腻子)
Solution:
解决方案:
- Uninstall oracle software, especially Oracle's client (OracleExpress Client and whole db 10g)
- Install Oracle 11g Client for Windows 7 64-bit. If occurs errors during installation (Config Net Assistant), check and clean previous Oracle's software. Everything including register and ORACLE_HOME, TNS_ADMIN environment variables should be removed.
- Install Oracles .NET tools for Visual Studio (it prevents 32 bit and 64 bit's conflict)
Configure TNSNAMES.ORA and SQLNET.ORA
- tnsnames.ora - check aliast with tnsping in cmd prompt (tnsping.exe exists in /bin
- check environment variables: ORACLE_HOME, optional TNS_ADMIN: “ORACLE_HOME/NETWORK/ADMIN”
sqlnet.ora variables :
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) SQLNET.AUTHENTICATION_SERVICES = (NTS) NAMES.DEFAULT_DOMAIN = ORCA
- 卸载oracle软件,尤其是Oracle的客户端(OracleExpress Client和整个db 10g)
- 安装适用于 Windows 7 64 位的 Oracle 11g 客户端。如果在安装(Config Net Assistant)过程中出现错误,请检查并清理以前的 Oracle 软件。包括 register 和 ORACLE_HOME、TNS_ADMIN 环境变量在内的所有内容都应该删除。
- 为 Visual Studio 安装 Oracles .NET 工具(它可以防止 32 位和 64 位冲突)
配置 TNSNAMES.ORA 和 SQLNET.ORA
- tnsnames.ora - 在 cmd 提示符下使用 tnsping 检查别名(tnsping.exe 存在于 /bin 中)
- 检查环境变量:ORACLE_HOME,可选 TNS_ADMIN:“ORACLE_HOME/NETWORK/ADMIN”
sqlnet.ora 变量:
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) SQLNET.AUTHENTICATION_SERVICES = (NTS) NAMES.DEFAULT_DOMAIN = ORCA
For me atleast works fine.
对我来说至少工作正常。
回答by Shawn
The problem seems to be with the 32-bit Oracle client and the "(x86)" in the long-name file path. I've got mine to work by using this in a .bat file.
问题似乎出在 32 位 Oracle 客户端和长名称文件路径中的“(x86)”上。我已经通过在 .bat 文件中使用它来工作。
start /B "C:\Progra~2\Microsoft Visual Studio 10\Common7\IDE" "C:\Progra~2\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"
启动 /B "C:\Progra~2\Microsoft Visual Studio 10\Common7\IDE" "C:\Progra~2\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"
回答by tbone
One quick easy solution is here:
https://stackoverflow.com/questions/1567133/very-frustrating-ora-12154-excpetion-finally-resolved
一个快速简单的解决方案在这里:https:
//stackoverflow.com/questions/1567133/very-frustrating-ora-12154-excpetion-finally-resolved
Basically, TOAD.exe, if run from a path containing parentheses, such as:
C:\Program Files (x86)\Quest Software\TOAD\Toad.exe
基本上,TOAD.exe,如果从包含括号的路径运行,例如:
C:\Program Files (x86)\Quest Software\TOAD\Toad.exe
...will encounter a TNS error when trying to conenct to a database:
ORA-12154: TNS:could not resolve the connect identifier specified
...尝试连接到数据库时会遇到 TNS 错误:
ORA-12154: TNS:could not resolve the connect identifier specified
Copy the entire Quest Software folder into C:\Program Files and you should be good to go.
将整个 Quest Software 文件夹复制到 C:\Program Files 中,您就可以开始使用了。