Oracle SQL Developer:失败 - 测试失败:网络适配器无法建立连接?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24127839/
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 SQL Developer: Failure - Test failed: The Network Adapter could not establish the connection?
提问by GeekyOmega
Problem
问题
Please note that I changed details for security purposes. However, the problem remains intact.
请注意,我出于安全目的更改了详细信息。然而,问题依然存在。
I installed an Oracle 11g database on a server at location, say, herp-devDV.derp.edu. Now I have another Oracle 11g database on a server at location, say, derp-db.derp.edu.
我在某个位置的服务器上安装了一个 Oracle 11g 数据库,例如 herp-devDV.derp.edu。现在,我在某个位置的服务器上有另一个 Oracle 11g 数据库,例如,derp-db.derp.edu。
I entered the connection name, username, password, hostname, and service name in Oracle SQL developer for both herp-devDV.derp.edu and derp-db.derp.edu. I can connect to schema in derp-db.derp.edu, but not herp-devDV.derp.edu. It gives me this message:
我在 Oracle SQL developer 中为 herp-devDV.derp.edu 和derp-db.derp.edu 输入了连接名称、用户名、密码、主机名和服务名称。我可以连接到 derp-db.derp.edu 中的模式,但不能连接到 herp-devDV.derp.edu。它给了我这样的信息:
Failure - Test failed: The Network Adapter could not establish the connection
Details
细节
I have the following information:
我有以下信息:
- Port 1521 is not open for either server when I telnet
- My listener is up and running for both.
- I can access derp-db.derp.edu on Oracle SQL Developer.
- Oracle client is on my local machine + Oracle SQL Developer
- I can remote desktop to both servers
- 当我 telnet 时,任一服务器都没有打开端口 1521
- 我的听众已启动并为两者运行。
- 我可以在 Oracle SQL Developer 上访问 derp-db.derp.edu。
- Oracle 客户端在我的本地机器上 + Oracle SQL Developer
- 我可以远程桌面到两台服务器
What I have done
我做了什么
- Googled
- Stackoverflow
- Ran stop and start lnrctl commands
- On herp-devDB.derp.edu I ran
lsnrctl status
- 谷歌搜索
- 堆栈溢出
- 运行停止和启动 lnrctl 命令
- 在 herp-devDB.derp.edu 我跑了
lsnrctl status
I received the following output
我收到以下输出
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
Start Date 03-JUN-2014 13:37:22
Uptime 6 days 0 hr. 53 min. 4 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File D:\oracle\product.2.0\dbhome_1\network\admin\listener.ora
Listener Log File d:\oracle\diag\tnslsnr\HERP-DEVDB\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=HERP-DEVDB.derp.edu)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "HERPDEVDBXDB" has 1 instance(s).
Instance "herpdevdb", status READY, has 1 handler(s) for this service...
Service "herpdevdb" has 1 instance(s).
Instance "herpdevdb", status READY, has 1 handler(s) for this service...
The command completed successfully
I then check out my listener.ora and find
然后我查看我的 listener.ora 并找到
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\oracle\product.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\oracle\product.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = HERP-DEVDB.derp.edu)(PORT = 1521))
)
)
At this point, I confess I am scratching my head as I don't see anything sticking out and telling me why this should not be working.
在这一点上,我承认我正在挠头,因为我没有看到任何突出的东西并告诉我为什么这不应该起作用。
The only clue is when I check derp-db.derp.edu and run the command lsnrctl status
. Please
see excerpt below:
唯一的线索是当我检查 derp-db.derp.edu 并运行命令时lsnrctl status
。请看下面的摘录:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DERP-DB.edu)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 11.2.0.3.0 - Production
Start Date 18-MAY-2014 02:19:01
Uptime 22 days 12 hr. 23 min. 18 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
---etc----
So I am still scratching my head. Why would derp-db be connecting to the DERP-DB.edu but herp-devDB is connecting to EXTPROC1521? How do I fix this? The listener.ora and other files between these two servers are almost identical except for the name of the instances. Hmmm.
所以我还在挠头。为什么derp-db 连接到DERP-DB.edu 而herp-devDB 连接到EXTPROC1521?我该如何解决?这两个服务器之间的 listener.ora 和其他文件几乎相同,只是实例的名称不同。嗯。
EDIT1:I changed the listener.ora in herp. This didn't fix it.
EDIT2:I cannot telnet into derp-db.derp.edu on port 1521. But I can still connect to it with SQL Developer? Wth?
- EDIT3I cannot telnet into herp-devdb.derp.edu on port 1521 either.
- EDIT4I cannot ping IP addresses of either server.
EDIT1:我更改了herp 中的listener.ora。这并没有解决它。
EDIT2:我无法在端口 1521 上 telnet 到 derp-db.derp.edu。但我仍然可以使用 SQL Developer 连接到它?什么?
- EDIT3我也无法在端口 1521 上 telnet 到 herp-devdb.derp.edu。
- EDIT4我无法 ping 任何一台服务器的 IP 地址。
Anyway assistance would be greatly appreciated. Thanks
无论如何,将不胜感激。谢谢
Regards, Geeky
问候,极客
回答by GeekyOmega
I am answering this for the benefit of future community users. There were multiple issues. If you encounter this problem, I suggest you look for the following:
我回答这个是为了未来社区用户的利益。有多个问题。如果您遇到此问题,建议您查找以下内容:
- Make sure your tnsnames.ora is complete and has the databases you wish to connect to
- Make sure you can tnsping the server you wish to connect to
- On the server, make sure it will be open on the port you desire with the specific application you are using.
- 确保你的 tnsnames.ora 是完整的并且有你想要连接的数据库
- 确保您可以 tnsping 要连接的服务器
- 在服务器上,确保它将在您使用的特定应用程序所需的端口上打开。
Once I did these three things, I solved my problem.
一旦我做了这三件事,我就解决了我的问题。
回答by scv
I had a similar issue where I also continuously got the same error. I tried many things like changing the listener port number, turning off the firewall etc. Finally I was able to resolve the issue by changing listener.ora file. I changed the following line:
我有一个类似的问题,我也不断遇到同样的错误。我尝试了很多事情,比如更改侦听器端口号、关闭防火墙等。最后我能够通过更改 listener.ora 文件来解决问题。我更改了以下行:
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
to
到
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))
I also added an entry in the /etc/hosts
file.
我还在/etc/hosts
文件中添加了一个条目。
you can use Oracle net manager to change the above line in listener.ora file. See Oracle Net Services Administrator's Guide for more information on how to do it using net manager.
您可以使用 Oracle 网络管理器更改 listener.ora 文件中的上述行。有关如何使用网络管理器执行此操作的更多信息,请参阅 Oracle 网络服务管理员指南。
Also you can use the service name (database_name.domain_name
) instead of SID while making the connnection.
您也可以database_name.domain_name
在进行连接时使用服务名称 ( ) 代替 SID。
I Hope it helps.
我希望它有帮助。
回答by Pete Ng
I just had same issue when I installed the oracle 11g and then creating the database.
当我安装 oracle 11g 然后创建数据库时,我遇到了同样的问题。
I don't even know that the listener has to create manually. Hence, I open Net Configuration Assistant and manually create the listener.
我什至不知道监听器必须手动创建。因此,我打开网络配置助手并手动创建侦听器。
And I can connect the database that I created locally through sql developer.
而且我可以通过sql developer连接我在本地创建的数据库。
回答by Diyar Bakir
I solved just by: given correct host and port so:
我只是通过以下方式解决:给定正确的主机和端口,因此:
- Open oracle net manager
- Local
- Listener
- 打开oracle网络管理器
- 当地的
- 听众
in Listener on address 2 then copy host to Oracle Developer
在地址 2 上的侦听器中,然后将主机复制到 Oracle Developer
finally connect to oracle
最后连接到oracle
回答by Mayank Agrawal
only start listner then u can connect with database. command run on editor:
只启动listner,然后你就可以连接数据库了。在编辑器上运行的命令:
lsnrctl start
lsnrctl 启动
its work fine.
它的工作正常。
回答by malatesh
This worked for me. may help some one. Turn off firewall. on RHEL 7
这对我有用。可能会帮助某人。关闭防火墙。在 RHEL 7 上
systemctl stop firewalld
回答by Fabien Haddadi
Curiously, I was able to solve the same issue by doing the exact opposite move to svc's ! I had to :
奇怪的是,我能够通过与 svc 完全相反的动作来解决同样的问题!我不得不 :
1) replace the FQDN hostname in my tnsnames.ora / listener.ora files with localhost, and restart the listener service, and
1) 将我的 tnsnames.ora / listener.ora 文件中的 FQDN 主机名替换为localhost,然后重新启动侦听器服务,然后
2) two, I had to use "SYS as SYSDBA" as the username in the SQL Developer input textbox
2)二,我不得不在SQL Developer输入文本框中使用“SYS as SYSDBA”作为用户名
to finally be able to have SQL Developer hook to my local instance.
最终能够让 SQL Developer 挂钩到我的本地实例。
回答by Codemaker
You can locate a file named listener.ora
under the installation folder oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
It contains the following entries
您可以listener.ora
在安装文件夹下找到一个名为的文件oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
它包含以下条目
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = Codemaker-PC)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
You should verify the HOST (Here it is Codemaker-PC) should be the computer name. If it's not correct the change it as computer name.
您应该验证主机(这里是 Codemaker-PC)应该是计算机名称。如果不正确,请将其更改为计算机名称。
then try the following command on the command prompt run as administrator,
然后在以管理员身份运行的命令提示符下尝试以下命令,
lsnrctl start
回答by ???
For me, the HOST was set differently in tnsnames.ora and listener.ora. One was set to the full name of the computer and the other was set to IP address. I synchronized them to the full name of the computer and it worked. Don't forget to restart the oracle services.
对我来说,tnsnames.ora 和 listener.ora 中的 HOST 设置不同。一个设置为计算机的全名,另一个设置为IP地址。我将它们同步到计算机的全名并且它起作用了。不要忘记重新启动 oracle 服务。
I still don't understand exactly why this caused problem because I think IP address and computer name are ultimately same in my understanding.
我仍然不明白为什么这会导致问题,因为我认为 IP 地址和计算机名称在我的理解中最终是相同的。
回答by Durgesh Gupta
I faced the same problem. I had to turn off my firewall, then it worked.
我遇到了同样的问题。我不得不关闭我的防火墙,然后它起作用了。
You could also open the port: http://windows.microsoft.com/en-in/windows/open-port-windows-firewall#1TC=windows-7
您也可以打开端口:http: //windows.microsoft.com/en-in/windows/open-port-windows-firewall#1TC=windows-7