Oracle SQL 开发人员:测试失败:网络适配器无法建立连接?
Oracle SQL Developer: Test failed: The Network Adapter could not establish the connection?
我真的需要帮助。我在 VirtualBox VM 上设置了一个 Oracle 数据库服务器,直到昨天一切似乎都运行良好。今天,当我启动数据库继续工作,并在我的本地机器(客户端机器)上打开 SQLDeveloper 时,它抛出了这个错误:
Erro de ES: The Network Adapter could not establish the connection
我的 VirtualBox VM 网络设置配置为 bridged adapter
。我能够很好地连接,今天,这个错误开始无缘无故地发生了。
我做了一些研究,但 none 对我有用。试图按照这个人的解决方案:
Oracle SQL Developer: Failure - Test failed: The Network Adapter could not establish the connection?
并且效果不佳。我要在这里分享我的 lsnrctl status
和我的文件,你可以看看。
首先,我是这样开始设置的:
1. lsnrctl start
启动侦听器。结果:
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
启动 sqlplus shell 然后 startup
启动数据库实例,这给出:
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.
然后我的lsnrctl status
给出:
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
我的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))
)
)
我的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)
)
)
当我尝试通过安装在虚拟机(即服务器端)中的 SQLDeveloper 连接数据库时,它工作正常,但是当我尝试从本地机器(客户端)上的 SQLDeveloper 连接时,我抛出错误。
我看到的每个 post 都让我查看监听器状态,但我认为这不是问题所在。
我很感激任何帮助的人。非常感谢您,我在这里回答任何其他信息。 =D
编辑:忘了说我使用的是 Oracle 数据库的 12c 版
编辑:这是我尝试连接到数据库的方式:
编辑:当我 ping
数据库的主机时,我得到这个:
[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
我曾经与 VM 网络设置作斗争,这样我的主机就可以 'see' 我的虚拟机,反之亦然。
一旦我了解了端口转发,我就不再担心这个了。
您可以简单地告诉 VirtualBox 从您的本地端口获取流量,例如 1521,然后将其转发到 VM,也可以说是 1521。
因此,当在 SQL Developer 中从我的主机连接到 VM 时,我可以转到 localhost:1521,并让我的连接流量转到我的 Linux VBox 上的 Oracle Listener图片,侦听端口 1521
点击端口转发
为 TCP 1521 和 1521 添加条目
然后,在 SQL Developer 中,您可以简单地执行此操作以连接到 VM 上的数据库
我很高兴你让它工作,但作为替代,让我说我不是这个问题的端口转发的忠实粉丝,我也不喜欢使用桥接适配器。我在 Windows 和 Ubuntu 主机上都在 VBox 下创建了许多虚拟机。在每种情况下,我都会创建 HOSTONLY 适配器,并使用固定的 IP 地址配置它。然后,我在主机的 'hosts' 文件中为虚拟机添加了一个条目。在 https://edstevensdba.wordpress.com/2012/12/15/configure-the-virtualbox-network-2/
查看更多详细信息
我真的需要帮助。我在 VirtualBox VM 上设置了一个 Oracle 数据库服务器,直到昨天一切似乎都运行良好。今天,当我启动数据库继续工作,并在我的本地机器(客户端机器)上打开 SQLDeveloper 时,它抛出了这个错误:
Erro de ES: The Network Adapter could not establish the connection
我的 VirtualBox VM 网络设置配置为 bridged adapter
。我能够很好地连接,今天,这个错误开始无缘无故地发生了。
我做了一些研究,但 none 对我有用。试图按照这个人的解决方案:
Oracle SQL Developer: Failure - Test failed: The Network Adapter could not establish the connection?
并且效果不佳。我要在这里分享我的 lsnrctl status
和我的文件,你可以看看。
首先,我是这样开始设置的:
1. lsnrctl start
启动侦听器。结果:
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
启动 sqlplus shell 然后 startup
启动数据库实例,这给出:
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.
然后我的lsnrctl status
给出:
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
我的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))
)
)
我的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)
)
)
当我尝试通过安装在虚拟机(即服务器端)中的 SQLDeveloper 连接数据库时,它工作正常,但是当我尝试从本地机器(客户端)上的 SQLDeveloper 连接时,我抛出错误。 我看到的每个 post 都让我查看监听器状态,但我认为这不是问题所在。
我很感激任何帮助的人。非常感谢您,我在这里回答任何其他信息。 =D
编辑:忘了说我使用的是 Oracle 数据库的 12c 版
编辑:这是我尝试连接到数据库的方式:
编辑:当我 ping
数据库的主机时,我得到这个:
[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
我曾经与 VM 网络设置作斗争,这样我的主机就可以 'see' 我的虚拟机,反之亦然。
一旦我了解了端口转发,我就不再担心这个了。
您可以简单地告诉 VirtualBox 从您的本地端口获取流量,例如 1521,然后将其转发到 VM,也可以说是 1521。
因此,当在 SQL Developer 中从我的主机连接到 VM 时,我可以转到 localhost:1521,并让我的连接流量转到我的 Linux VBox 上的 Oracle Listener图片,侦听端口 1521
点击端口转发
为 TCP 1521 和 1521 添加条目
然后,在 SQL Developer 中,您可以简单地执行此操作以连接到 VM 上的数据库
我很高兴你让它工作,但作为替代,让我说我不是这个问题的端口转发的忠实粉丝,我也不喜欢使用桥接适配器。我在 Windows 和 Ubuntu 主机上都在 VBox 下创建了许多虚拟机。在每种情况下,我都会创建 HOSTONLY 适配器,并使用固定的 IP 地址配置它。然后,我在主机的 'hosts' 文件中为虚拟机添加了一个条目。在 https://edstevensdba.wordpress.com/2012/12/15/configure-the-virtualbox-network-2/
查看更多详细信息