windows Oracle Express Edition - 无法远程连接(以及其他)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/261867/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:39:54  来源:igfitidea点击:

Oracle Express Edition - Can not connect remotely (plus others)

windowsoracle-xe

提问by user34142

I'm unable to make a remote connection to an Oracle XE install (through TOAD / SQL Developer). Here's the deal.

我无法远程连接到 Oracle XE 安装(通过 TOAD/SQL Developer)。这是交易。

I set up a new server (windows 2003). The goal was to make a new image with several applications preinstalled, Oracle XE being one of them. Got Oracle installed no problem, connected locally, remotely and had access to the web interface - the one found at http://127.0.0.1:8081/apex(Note: I changed the port of the web interface manually as we are running our Tomcat dev environment on 8080).

我设置了一个新服务器(Windows 2003)。目标是制作一个预装了多个应用程序的新映像,Oracle XE 就是其中之一。安装 Oracle 没问题,在本地、远程连接并可以访问 Web 界面 - 在http://127.0.0.1:8081/apex找到的那个(注意:我在运行我们的 Web 界面时手动更改了 Web 界面的端口8080 上的 Tomcat 开发环境)。

So, everything is going swimmingly, I create the image, wipe the machine and put the newly created image on there. Everything works except Oracle. After much digging, I update the tnsnames.ora file, add environment variables ORACLE_HOME and ORACLE_SID, so I can connect locally. I still can't connect remotely and have completely lost access to the web interface. I've spent 2 days on google and I'm all out of ideas. Please HELP!

所以,一切都很顺利,我创建图像,擦拭机器并将新创建的图像放在那里。除 Oracle 外,一切正常。经过一番挖掘,我更新了tnsnames.ora文件,添加了环境变量ORACLE_HOME和ORACLE_SID,这样我就可以本地连接了。 我仍然无法远程连接并且完全无法访问 Web 界面。我在谷歌上呆了 2 天,我已经没有想法了。请帮忙!

回答by Gary Myers

ManuelF relates to access through the web front end, but isn't relevant to local access through the web front end.

ManuelF 与通过 Web 前端的访问相关,但与通过 Web 前端的本地访问无关。

You don't say how hostname/address is being handled, or how you are connecting locally. If you are doing SQLPLUS / AS SYSDBAthen you are attaching directly. If you are doing SQLPLUS user/pass@XEthen you are attaching via the listener. If the former works and the latter doesn't, look for a file called listener.ora and check the hostname in there. If you still have problems, try

您没有说明如何处理主机名/地址,或者您在本地连接的方式。如果你这样做, SQLPLUS / AS SYSDBA那么你是直接附加的。如果你这样做,SQLPLUS user/pass@XE那么你是通过监听器附加的。如果前者有效而后者无效,请查找名为 listener.ora 的文件并检查其中的主机名。如果仍有问题,请尝试

sqlplus user/[email protected]:1521/XE

If that works, then the problem is the tnsnames.ora.

如果这有效,那么问题是 tnsnames.ora。

On the remote access, if your image is installed on 'box a', and you want access from 'box b', can you ping 'box a' from 'box b'. Then try, on box_b

在远程访问中,如果您的映像安装在“box a”上,并且您想从“box b”访问,则可以从“box b”ping“box a”。然后尝试,在 box_b 上

sqlplus user/pass@box_a:1521/XE

This assumes you have an Oracle client, with sql*plus, on box_b. If that works, you'll need to look at the tnsnames.ora file on box_b. If you don't have an Oracle client on box_b, Oracle's SQL Developer can connect through the JDBC thin driver (which doesn't need any Oracle client), and for that you'll need to specify the host, listener port (generally 1521) and sid (XE for express edition)

这假设您在 box_b 上有一个带有 sql*plus 的 Oracle 客户端。如果可行,您将需要查看 box_b 上的 tnsnames.ora 文件。如果 box_b 上没有 Oracle 客户端,Oracle 的 SQL Developer 可以通过 JDBC 瘦驱动程序连接(不需要任何 Oracle 客户端),为此您需要指定主机、侦听器端口(通常为 1521 ) 和 sid (XE for express edition)

回答by zendar

Did you check if you have open port 1521 on firewall?

您是否检查过防火墙上是否打开了 1521 端口?

回答by Manuel Ferreria

From the Web Interface, you have to login as a DBA [I think], and there is an option in the administration section where you have to activate "Enable connections from outside".

从 Web 界面,您必须以 DBA 身份登录 [我认为],并且在管理部分有一个选项,您必须在其中激活“启用来自外部的连接”。

EDIT: Full Path : WebInterface -> Administration -> [drop down menu] Manage HTTP Access -> Available from local server and remote clients.

编辑:完整路径:WebInterface -> 管理 -> [下拉菜单] 管理 HTTP 访问 -> 可从本地服务器和远程客户端使用。

回答by Johann Horvat

Just login into sqlplus as sysdba or system user and let the following command go:

只需以 sysdba 或系统用户身份登录 sqlplus 并执行以下命令:

execute dbms_xdb.setListenerLocalAccess(l_access => FALSE);

回答by perlyking

I discovered that remote connections were failing to my Ubuntu box because I'd misconfigured the /etc/hostsfile. The machine had a static IP set up in /etc/interfaces, but the entry in hosts had the wrong IP address:

我发现远程连接无法连接到我的 Ubuntu 机器,因为我错误地配置了/etc/hosts文件。机器在 中设置了静态 IP /etc/interfaces,但主机中的条目具有错误的 IP 地址:

127.0.0.1       localhost
127.0.1.1       fqdn.domain.com        myhost
sta.tic.ip.address        fqdn.domain.com        myhost

The last line had the wrong IP.

最后一行有错误的IP。

As a result, running lnsrctl statusdid not list the XE service. Once I corrected the hosts file, I restarted the oracle-xe service and remote connections began to work.

结果,运行lnsrctl status没有列出XE服务。更正主机文件后,我重新启动了 oracle-xe 服务,远程连接开始工作。

回答by Kishore

I have similar issue with windows 8.1 running with firewall. I have installed Oracle XE 11g and installed Oracle Application express 5.0.2. Everything is working as expected in the local host / machine. Only issue was unable to login to oracle application express from the remote machine within LAN.

我在使用防火墙运行的 Windows 8.1 上有类似的问题。我已经安装了 Oracle XE 11g 并安装了 Oracle Application express 5.0.2。一切都在本地主机/机器上按预期工作。唯一的问题是无法从局域网内的远程机器登录到 oracle application express。

After some research, resolved the issue by adding TNSLSNR executable to windows fire wall settings as below.

经过一些研究,通过将 TNSLSNR 可执行文件添加到 Windows 防火墙设置解决了该问题,如下所示。

System and Security --> Windows Firewall --> Allowed apps

系统和安全 --> Windows 防火墙 --> 允许的应用程序

回答by Esmaeil MIRZAEE

make sure remote connection is enabled in your machine. on the local machine connect to http://localhost:8080/apex/as SYSTEM user, then go to Administrationand from right side panel choose Manage HTTP Accessthen in the following window choose

确保在您的机器中启用了远程连接。在本地机器上http://localhost:8080/apex/以 SYSTEM 用户身份连接,然后转到管理并从右侧面板中选择管理 HTTP 访问,然后在以下窗口中选择

Available from local server and remote clients

可从本地服务器和远程客户端使用

so press apply changes.

所以按应用更改。

In my machine I have to restart to get result.

在我的机器中,我必须重新启动才能获得结果。