我找到了解决这个问题的方法。为了解释我的解决方案,我使用了一些别名来指代我的真实参数。它们是:
[ME] = my user name
[MYHOST] = my current workstation hostname (netbios name as well)
[MYHOST.mycompany.com] = my worksation's fully qualified domain name
一开始我也遇到了和上面说的一样的情况:安装成功后还是连接不上apex服务。
首先我使用了 tnsping oracle 实用程序:
C:\Users\ME>tnsping MYHOST
这就是答案:
TNS Ping Utility for 32-bit Windows: Version 11.2.0.2.0 - Production
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product\11.2.0\server\network\admin\sqlnet.ora
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=
(PROTOCOL=TCP)(HOST=fe80::5d34:78a:5862:64%20)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=fe80::c27:54a4:1600:86a4%26)(PORT=1521))(ADDRESS=
(PROTOCOL=TCP)(HOST=fe80::38ab:cdb4:dd77:7ed9%12)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)
(HOST=10.9.32.208)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.1)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.106)(PORT=1521)))
TNS-12541: TNS:no listener
您在上面看到了许多当前处于活动状态的不同 IP 地址。只有最重要的 127.0.0.1 丢失了。我在笔记本上工作,所以网络“几乎总是”在变化(WLAN、3G、HSDPA、以太网等),只有本地主机是固定的。这就是麻烦的真实情况。 (当我在连接到办公网络的办公环境中工作时,它也在工作。)
当我遇到这种情况时,我也开始使用 lsnrctl oracle 实用程序。
我看到了以下内容:
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Production
Default Service XE
Listener Parameter File /oraclexe/app/oracle/product/11.2.0/server\network\admin\listener.ora
Listener Log File C:\oraclexe\app\oracle\diag\tnslsnr\MYHOST\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=MYHOST.mycompany.com)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
你可以看到8080端口的apex服务不见了!!!
我也尝试过正常的 ping,效果很好:
C:\Users\ME>ping MYHOST.mycompany.com
结果是:
MYHOST.mycompany.com [fe80::c27:54a4:1600:86a4%26] ping
response fe80::c27:54a4:1600:86a4%26: time<10 ms
...
您可以意识到 IPv6 地址也存在于我的 tnsping 试用版中。
所以我决定直接在我的本地hosts文件中定义MYHOST:
127.0.0.1 localhost MYHOST MYHOST.mycompany.com
现在用 ping 测试:
C:\Users\ME>ping MYHOST
答案是:
MYHOST.mycompany.com [127.0.0.1] ping:
response 127.0.0.1: byte=32 time<10 ms. TTL=128
...
此时我已经重新启动(停止并重新启动)两个正在运行的 Oracle 服务(只是肯定的):
OracleServiceXE
OracleXETNSListener
看看奇迹:
C:\Users\ME>lsnrctl
LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Production
Default Service XE
Listener Parameter File /oraclexe/app/oracle/product/11.2.0/server\network\admin\listener.ora
Listener Log File C:\oraclexe\app\oracle\diag\tnslsnr\MYHOST\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=MYHOST.mycompany.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=MYHOST.mycompany.com)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
您可以看到 PORT=8080 和服务 XE 实例的重要行。
所以我很高兴入门 URL 再次起作用。