Oracle 数据库 12c 尝试连接时出错:网络适配器无法建立连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23851161/
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
Oracle database 12c Error while trying to connect: The Network Adapter could not establish the connection
提问by user3558977
I installed Oracle database 12c for the first time. I followed correctly all the steps and installed it on Windows 7 64 bits, but when I click on SQL Developer and try to create a new connection, I put in the informations like Username and password, and finnaly click on TEST button, I get this error message: "The Network Adapter could not establish the connection".
我是第一次安装 Oracle 数据库 12c。我正确地遵循了所有步骤并将其安装在 Windows 7 64 位上,但是当我单击 SQL Developer 并尝试创建一个新连接时,我输入了用户名和密码等信息,最后单击了 TEST 按钮,我得到了这个错误消息:“网络适配器无法建立连接”。
I dont know what to do anymore, I read tutorials and cant solve that error. Also, when I open SQL Developer, i get a message saying Im using a java version that is not supported by Oracle Database, Im using java 1.8 and it says I should use from 1.6 to 1.7 only. im not sure if that is causing something bad but it seems fine because I can go further using the SQL Dev. So, what should i do? Thank you very much!
我不知道该怎么办了,我阅读了教程,但无法解决该错误。此外,当我打开 SQL Developer 时,我收到一条消息,说我使用的是 Oracle 数据库不支持的 java 版本,我使用的是 java 1.8,它说我应该只使用 1.6 到 1.7。我不确定这是否会导致一些不好的事情,但看起来很好,因为我可以使用 SQL Dev 进一步发展。所以我该怎么做?非常感谢!
回答by Urantian
Here are some things to check:
以下是一些需要检查的事项:
Ensure that the TNSNAMES.ORA file is properly configured to reference the database. Check for the SID, host name, and port number (typically 1521).
Check whether you can connect directly from the server, such as with SQL PLus. This should isolate whether it's a server or client problem.
Ensure that the Listener service on the server is running. Check that LISTENER.ORA is properly configured.
I encountered a situation in the past where client PCs could not connect. I found that by deleting (or renaming) the SQLNET.ORA file, the connection could be made.
确保 TNSNAMES.ORA 文件已正确配置为引用数据库。检查 SID、主机名和端口号(通常为 1521)。
检查是否可以直接从服务器连接,例如使用 SQL PLus。这应该隔离是服务器问题还是客户端问题。
确保服务器上的侦听器服务正在运行。检查 LISTENER.ORA 是否正确配置。
我过去遇到过客户端 PC 无法连接的情况。我发现通过删除(或重命名)SQLNET.ORA 文件,可以建立连接。
Good luck.
祝你好运。
回答by Mart Rivilis
Execute
执行
tnsping <db_name>
from command prompt. You will see, if listener is running and tnsnames.ora is configured properly.
从命令提示符。您会看到,如果侦听器正在运行并且 tnsnames.ora 配置正确。
回答by quangkid
Run with Windows PowerShell or Command Prompt (Admin) :
使用 Windows PowerShell 或命令提示符(管理员)运行:
lsnrctl start