oracle 连接到oracle
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2441274/
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
connecting to oracle
提问by LIX
I have a report server project in VS2005, and I added an oracle data source to my project and I did anything like my colleage! both of us did the same settings but I can't connect to the server. I connected to DB in TOAD but in VS2005 I couldn't. What should I check?
I get this error during test connection :
ORA-12154: TNS:could not resolve the connect identifier specified
我在 VS2005 中有一个报表服务器项目,我在我的项目中添加了一个 oracle 数据源,我做了像我的大学一样的任何事情!我们都做了相同的设置,但我无法连接到服务器。我在 TOAD 中连接到 DB,但在 VS2005 中我不能。我应该检查什么?
我在测试连接期间收到此错误:
ORA-12154:TNS:无法解析指定的连接标识符
回答by LIX
I tried HOST:PORT/MYDBServerName section to connect to oracle directly and it worked.
我尝试了HOST:PORT/MYDBServerName 部分直接连接到 oracle 并且它工作正常。
回答by Wilma
We had issues connecting to databases using the TNSNAMES.ora in Visual Studio 2010.
The TNSNAMES file was correct, the oracle installation was correct, but the connections could not be selected in the "Add Connection" screen.
It turned out that the TNSNAMES had too many entries for the Data Source name select field in the "Add Connection" screen.
Reducing the entries in the TNSNAMES file resolved the issue.
我们在 Visual Studio 2010 中使用 TNSNAMES.ora 连接到数据库时遇到问题
。TNSNAMES 文件正确,oracle 安装正确,但无法在“添加连接”屏幕中选择连接。
结果发现,TNSNAMES 在“添加连接”屏幕中的数据源名称选择字段中包含太多条目。
减少 TNSNAMES 文件中的条目解决了该问题。
回答by Will Marcouiller
You should do fine with the following link:
您应该可以使用以下链接:
ORA-12154: TNS:could not resolve the connect identifier specified
Cause:
原因:
A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured. For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, or the repository could not be located or reached.
使用连接标识符请求连接到数据库或其他服务,并且无法使用配置的命名方法之一将指定的连接标识符解析为连接描述符。例如,如果使用的连接标识符类型是网络服务名称,则无法在命名方法存储库中找到该网络服务名称,或者无法定位或访问该存储库。
Action:
行动:
- If you are using local naming (TNSNAMES.ORA file):
- 如果您使用本地命名(TNSNAMES.ORA 文件):
Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)
Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.
Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.
Make sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Look for unmatched parentheses or stray characters. Errors in a TNSNAMES.ORA file may make it unusable.
确保“TNSNAMES”被列为 Oracle Net 配置文件 (SQLNET.ORA) 中 NAMES.DIRECTORY_PATH 参数的值之一
验证 TNSNAMES.ORA 文件是否存在并且位于正确的目录中并且可以访问。
检查用作连接标识符的网络服务名称是否存在于 TNSNAMES.ORA 文件中。
确保 TNSNAMES.ORA 文件中的任何地方都没有语法错误。查找不匹配的括号或杂散字符。TNSNAMES.ORA 文件中的错误可能会使其无法使用。
- If you are using directory naming:
- 如果您使用目录命名:
Verify that "LDAP" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
Verify that the LDAP directory server is up and that it is accessible.
Verify that the net service name or database name used as the connect identifier is configured in the directory.
Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect identifier
验证“LDAP”是否被列为 Oracle Net 配置文件 (SQLNET.ORA) 中 NAMES.DIRETORY_PATH 参数的值之一。
验证 LDAP 目录服务器是否已启动并且可以访问。
验证用作连接标识符的网络服务名称或数据库名称是否已在目录中配置。
通过指定完全限定的网络服务名称或完整的 LDAP DN 作为连接标识符来验证所使用的默认上下文是否正确
- If you are using easy connect naming:
- 如果您使用简单的连接命名:
Verify that "EZCONNECT" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
Make sure the host, port and service name specified are correct.
Try enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system specific guide for more information on naming.
验证“EZCONNECT”是否被列为 Oracle 网络配置文件 (SQLNET.ORA) 中 NAMES.DIRETORY_PATH 参数的值之一。
确保指定的主机、端口和服务名称正确。
尝试将连接标识符括在引号中。有关命名的更多信息,请参阅 Oracle 网络服务管理员指南或 Oracle 操作系统特定指南。
EDIT
编辑
Problem connecting to Oracle database
Build a .NET Application on the Oracle Database with Visual Studio 2005 or 2008
使用 Visual Studio 2005 或 2008 在 Oracle 数据库上构建 .NET 应用程序
Problems connecting to Oracle 9i database with Oracle 10g Client and Win XP x64