我已经在Oracle Enterprise Linux中安装了VirtualBox映像。它包含已安装的Oracle Database 12.1.0。
在虚拟机网络设置中,我选择“Bridget Adapter”。接下来在Linux上我配置了连接设置:静态IP地址:192.168.0.110
现在我可以使用ping 192.168.0.110 ping到虚拟机。
虚拟机上的文件:
的tnsnames.ora:
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
pdb1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdb1)
)
)
的listener.ora:
# listener.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 0.0.0.0) (PORT = 80))
(PROTOCOL_STACK = (PRESENTATION = HTTP) (SESSION = RAW))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 0.0.0.0) (PORT = 21))
(PROTOCOL_STACK = (PRESENTATION = FTP) (SESSION = RAW))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
现在我尝试使用以下连接属性从主机(Windows)连接我的数据库: 用户名:system 密码:oracle 主机名:192.168.0.110 港口:1521 服务名称:orcl
我收到以下错误: 网络适配器无法建立连接
答案 0 :(得分:0)
检查oracle企业级Linux防火墙中的端口1521是否已打开,或者这只是一个测试系统禁用防火墙。
如果您在主机上有telnet可用,您可以通过端口1521 telnet到guest虚拟机并查看您获得的响应 - 对调试很有用