我是Oracle数据库的新手,但我遇到了一个问题。
在我的数据库服务器(server1)上,监听器和数据库实例都正常运行,我可以使用sqlplus
连接到此数据库。
当我使用其他服务器连接数据库时,我检查了TNS配置,并且它是正确的,但系统显示:
ERROR:
ORA-12541: TNS:no listener
我的数据库是Oracle 10gR2
那么我该如何解决这个问题呢?
我是Oracle数据库的新手,但我遇到了一个问题。
在我的数据库服务器(server1)上,监听器和数据库实例都正常运行,我可以使用sqlplus
连接到此数据库。
当我使用其他服务器连接数据库时,我检查了TNS配置,并且它是正确的,但系统显示:
ERROR:
ORA-12541: TNS:no listener
我的数据库是Oracle 10gR2
那么我该如何解决这个问题呢?
你需要设置 Oracle 监听所有 IP 地址(默认情况下,它仅监听本地连接)。
listener.ora
该文件位于:
%ORACLE_HOME%\network\admin\listener.ora
。用 0.0.0.0
替换 localhost
# ...
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
)
)
# ...
Windows: WinKey + r
services.msc
Linux (CentOS):
sudo systemctl restart oracle-xe
我也遇到了同样的问题,但是我通过在控制面板 -> 管理工具 -> 服务 -> Oracle TNS 监听器启动中启动TNS监听器来解决了这个问题。我使用Windows XP和Toad连接Oracle。
tnsping YourOracleSID
,如果出现错误,请查看此处的解决方案,例如尝试 LSNRCTL.EXE start
:https://sort.veritas.com/public/documents/ccser/5.2/windowsandunix/productguides/html/ccer_install/ch03s05.htm - yu yang Jian请检查您的TNS名称,别名左侧不得有空格。
最好的问候
ORA-12541:TNS:没有监听程序
Cause: The connection request could not be completed because the listener is not running.
Action: Ensure that the supplied destination address matches one of the addresses used by
the listener - compare the TNSNAMES.ORA entry with the appropriate LISTENER.ORA file (or
TNSNAV.ORA if the connection is to go by way of an Interchange). Start the listener on
the remote machine.