Oracle SQL Developer:测试失败:网络适配器无法建立连接? [英] Oracle SQL Developer: Test failed: The Network Adapter could not establish the connection?
问题描述
我真的需要帮助.我在 VirtualBox VM 上设置了 Oracle 数据库服务器,直到昨天一切似乎都运行良好.今天,当我启动数据库以继续工作,并在我的本地机器(客户端机器)上打开 SQLDeveloper 时,它向我抛出了这个错误:
Erro de ES: 网络适配器无法建立连接
我的 VirtualBox VM 网络设置配置为 bridged adapter
.我能够正常连接,今天,这个错误开始发生.
我做了一些研究,但没有一个对我有用.试图按照这个人的解决方案:
EDIT:当我ping
数据库的主机时,我得到这个:
[oracle@dbserver admin]$ ping dbserverPING dbserver(dbserver (fe80::f8dd:c03c:920c:5442%enp0s3)) 56 个数据字节来自 dbserver 的 64 字节 (fe80::f8dd:c03c:920c:5442%enp0s3):icmp_seq=1 ttl=64 时间=0.075 ms来自 dbserver 的 64 字节 (fe80::f8dd:c03c:920c:5442%enp0s3):icmp_seq=2 ttl=64 时间=0.053 ms来自 dbserver 的 64 字节 (fe80::f8dd:c03c:920c:5442%enp0s3):icmp_seq=3 ttl=64 时间=0.051 ms来自 dbserver 的 64 字节 (fe80::f8dd:c03c:920c:5442%enp0s3):icmp_seq=4 ttl=64 时间=0.072 ms来自 dbserver 的 64 字节 (fe80::f8dd:c03c:920c:5442%enp0s3):icmp_seq=5 ttl=64 时间=0.049 ms^C--- dbserver ping 统计信息 ---发送 5 个数据包,接收 5 个数据包,0% 数据包丢失,时间 131msrtt min/avg/max/mdev = 0.049/0.060/0.075/0.011 毫秒
我过去常常与 VM 网络设置作斗争,这样我的主机就可以看到"我的 vm,反之亦然.
一旦我了解了端口转发,我就不再担心这个了.
您可以简单地告诉 VirtualBox 从您的本地端口(例如 1521)获取流量,并将其转发到 VM,例如 1521.
因此,当在 SQL Developer 中从我的主机连接到 VM 时,我可以转到 localhost:1521,并使我的连接流量转到 Linux VBox 映像上的 Oracle 侦听器,侦听端口 1521
点击端口转发
为 TCP 1521 和 1521 添加条目
然后,在 SQL Developer 中,您只需执行此操作即可连接到 VM 上的数据库
I'm in real need of a help here. I setup a Oracle Database server on a VirtualBox VM and until yesterday everything seemed to work just fine. Today when I initiated the database to keep working, and turned on SQLDeveloper in my local machine (Client machine) it threw me this error:
Erro de ES: The Network Adapter could not establish the connection
My VirtualBox VM network setting is configure to bridged adapter
. And I was able to connect just fine and today, out of nothing this error started occurring.
I did some research but none of them worked for me. Tried to follow this guy solution:
Oracle SQL Developer: Failure - Test failed: The Network Adapter could not establish the connection?
And didn't work as well. I'm gonna share my lsnrctl status
and my file here so you can take a look.
First this is how I start my setup:
1. lsnrctl start
to start the listener. Resulting in:
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 24-AUG-2020 10:40:56
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Starting /u01/app/oracle/product/12.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/dbserver/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbserver)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 24-AUG-2020 10:40:56
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/dbserver/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
2. sqlplus / as sysdba
to start sqlplus shell and then startup
to start the database instance, which gives:
ORACLE instance started.
Total System Global Area 2550136832 bytes
Fixed Size 8623928 bytes
Variable Size 671090888 bytes
Database Buffers 1862270976 bytes
Redo Buffers 8151040 bytes
Database mounted.
Database opened.
Then my lsnrctl status
gives:
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 24-AUG-2020 10:46:34
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbserver)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 24-AUG-2020 10:40:56
Uptime 0 days 0 hr. 5 min. 38 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/dbserver/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=dbserver)(PORT=5500))(Security=(I removed the path for security))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
My listener.ora
:
# listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbserver)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
My tnsnames.ora
:
GNU nano 2.9.8 tnsnames.ora Modified
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbserver)(PORT = 1521))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbserver)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
When I try to connect in the database through the SQLDeveloper installed inside the Virtual Machine (That is the server side) it works ok, but when I try to connect from the SQLDeveloper on the local machine (Client side) i throws the error. Every post I saw, told me to look on the listener status, but that is not the problem, I think.
I'd appreciate any help guys. And thank you very much, any additional information I`m here to answer. =D
EDIT: forgot to mention that I'm using version 12c of the Oracle Databse
EDIT: Here is how I'm trying to connect to the DB:
EDIT: When I ping
the host for the DB I get this:
[oracle@dbserver admin]$ ping dbserver
PING dbserver(dbserver (fe80::f8dd:c03c:920c:5442%enp0s3)) 56 data bytes
64 bytes from dbserver (fe80::f8dd:c03c:920c:5442%enp0s3): icmp_seq=1 ttl=64 time=0.075 ms
64 bytes from dbserver (fe80::f8dd:c03c:920c:5442%enp0s3): icmp_seq=2 ttl=64 time=0.053 ms
64 bytes from dbserver (fe80::f8dd:c03c:920c:5442%enp0s3): icmp_seq=3 ttl=64 time=0.051 ms
64 bytes from dbserver (fe80::f8dd:c03c:920c:5442%enp0s3): icmp_seq=4 ttl=64 time=0.072 ms
64 bytes from dbserver (fe80::f8dd:c03c:920c:5442%enp0s3): icmp_seq=5 ttl=64 time=0.049 ms
^C
--- dbserver ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 131ms
rtt min/avg/max/mdev = 0.049/0.060/0.075/0.011 ms
I used to fight with VM networking settings such that my host could 'see' my vm, and vice versa.
I stopped worrying about this once i learned about port forwards.
You can simply tell VirtualBox to take traffic from your local port, say 1521, and forward that to the VM, say also 1521.
So when connecting to the VM from my host in SQL Developer, I can go to localhost:1521, and have my connection traffic go to the Oracle Listener on my Linux VBox image, listening on port 1521
Click on Port Forwarding
Add an entry for TCP 1521 and 1521
Then, in SQL Developer you can simply do this to connect to your DB on the VM
这篇关于Oracle SQL Developer:测试失败:网络适配器无法建立连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!