如何仅在本地主机上运行 Oracle XE?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4982699/
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
How can I run Oracle XE on localhost only?
提问by Joel
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.
有没有办法可以在 Windows 上配置 XE 安装以仅使用本地主机接口上的端口而不使用外部接口?我想在没有其他人能够连接到我的实例的情况下运行它进行开发。
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:
我尝试修改 listener.ora 和 tnsnames.ora 文件,将“HOST =”条目更改为 localhost。我的主机文件中有以下行:
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:
完成此操作并重新启动服务后,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
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.
我应该注意到,如果我将 'HOST = 条目更改回我的机器主机名并重新启动服务,apex 和 JDBC 都可以正常工作。
回答by Gary Myers
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.ORAsetting (tcp.invited_nodes) as a soft firewall, so the listener will ignore other nodes.
首先对数据库端口1521监听您使用SQLNET.ORA设置(tcp.invited_nodes)作为软防火墙,所以听者会忽略其他节点。
Secondly, for the 8080 PL/SQL gateway you need to use DBMS_XDB.SETLISTENERLOCALACCESS as described here
其次,对于8080 PL / SQL网关,您需要使用DBMS_XDB.SETLISTENERLOCALACCESS描述这里