Oracle 客户端 ORA-12541:TNS:无侦听器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13358656/
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
Oracle client ORA-12541: TNS:no listener
提问by aliasosx
I am new on Oracle database, but I have one issue.
On my Database server (server1) listener and database instance run correctly and I can use sqlplus
to connect to this DB.
When I connect to database by using other server, I check the TNS configuration and it is correct but system says:
我是 Oracle 数据库的新手,但我有一个问题。在我的数据库服务器 (server1) 侦听器和数据库实例上运行正常,我可以sqlplus
用来连接到这个数据库。当我使用其他服务器连接到数据库时,我检查了 TNS 配置,它是正确的,但系统说:
ERROR: ORA-12541: TNS:no listener
ERROR: ORA-12541: TNS:no listener
My database is Oracle 10gR2
我的数据库是 Oracle 10gR2
So how can I solve this issue?
那么我该如何解决这个问题呢?
回答by Mikael Holmgren
You need to set oracle to listen on all ip addresses (by default, it listens only to localhost connections.)
您需要将 oracle 设置为侦听所有 ip 地址(默认情况下,它仅侦听 localhost 连接。)
Step 1 - Editlistener.ora
第 1 步 -编辑listener.ora
This file is located in:
该文件位于:
- Windows:
%ORACLE_HOME%\network\admin\listener.ora
. - Linux: $ORACLE_HOME/network/admin/listener.ora
- 窗户:
%ORACLE_HOME%\network\admin\listener.ora
。 - Linux:$ORACLE_HOME/network/admin/listener.ora
Replacelocalhost
with0.0.0.0
替换localhost
为0.0.0.0
# ...
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
)
)
# ...
Step 2 - Restart Oracle services
步骤 2 - 重启 Oracle 服务
Windows: WinKey+ r
services.msc
Linux (CentOs):
sudo systemctl restart oracle-xe
窗户:WinKey+r
services.msc
Linux (CentOs):
sudo systemctl restart oracle-xe
回答by subhashis
I also faced the same problem but I resolved the issue by starting the TNS listener in control panel -> administrative tools -> services ->oracle TNS listener start.I am using windows Xp and Toad to connect to Oracle.
我也遇到了同样的问题,但我通过在控制面板 -> 管理工具 -> 服务 -> oracle TNS 侦听器启动中启动 TNS 侦听器解决了该问题。我使用 Windows Xp 和 Toad 连接到 Oracle。
回答by dariyoosh
According to oracle online documentation
根据oracle在线文档
ORA-12541: TNS:no listener
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.
回答by Armand
Check out your TNS Names, this must not have spaces at the left side of the ALIAS
检查您的 TNS 名称,这在 ALIAS 的左侧不能有空格
Best regards
此致