如何仅在本地主机上运行 Oracle XE?
有没有办法可以将 Windows 上的 XE 安装配置为仅使用本地主机接口上的端口而不使用外部接口?我想运行它进行开发,而不让其他人能够连接到我的实例。
我尝试修改listener.ora和tnsnames.ora文件,将'HOST ='条目更改为localhost。我的主机文件中有以下行:
127.0.0.1 localhost
当我完成此操作并重新启动服务时,apex 停止工作(它不侦听端口 8080),并且我无法使用 JDBC 连接到数据库。我在使用 JDBC 时遇到以下错误:
Exception in thread "main" java.sql.SQLException: Listener refused the connection
with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect
descriptor
The Connection descriptor used by the client was:
localhost:1521:XE
我应该注意到,如果我将 'HOST = 条目更改回我的计算机主机名并重新启动服务,则 apex 和 JDBC 都可以正常工作。
Is there a way that I can configure a XE installation on Windows to only use ports on the localhost interface and not the external interfaces? I'd like to run it for development without having anyone else be able to connect to my instance.
I tried modifying the listener.ora and tnsnames.ora file, changing the 'HOST =' entries to localhost. My hosts file has the following line in it:
127.0.0.1 localhost
When I've done this, and restarted the services, apex stops working (it doesn't listen on port 8080) and I'm unable to connect to the database using JDBC. I get the following error with JDBC:
Exception in thread "main" java.sql.SQLException: Listener refused the connection
with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect
descriptor
The Connection descriptor used by the client was:
localhost:1521:XE
I should note that both apex and JDBC work fine if I change the 'HOST = entries back to my machines hostname and restart the services.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这有两个部分(因为有两种“技术”服务于不同的端口)。
首先是数据库端口 1521 的侦听器。您使用 SQLNET.ORA 设置 (tcp.invited_nodes )作为软防火墙,所以监听器会忽略其他节点。
其次,对于 8080 PL/SQL 网关,您需要使用 DBMS_XDB.SETLISTENERLOCALACCESS,如此处
There are two parts for this (because there are two 'technologies' serving different ports).
Firstly the listener for database port 1521. You use a SQLNET.ORA setting (tcp.invited_nodes) as a soft firewall, so the listener will ignore other nodes.
Secondly, for the 8080 PL/SQL gateway you need to use DBMS_XDB.SETLISTENERLOCALACCESS as described here