Oracle客户端ORA-12541:TNS:无监听器

Oracle client ORA-12541: TNS:no listener

我是Oracle数据库的新手,但有一个问题。
在我的数据库服务器(server1)上,侦听器和数据库实例正确运行,并且我可以使用sqlplus连接到该数据库。
当我使用其他服务器连接到数据库时,我检查了TNS配置并且它是正确的,但是系统显示:

1
2
ERROR:
ORA-12541: TNS:no listener

我的数据库是Oracle 10gR2

那我该如何解决这个问题?


您需要将oracle设置为侦听所有ip地址(默认情况下,它仅侦听localhost连接。)

步骤1-编辑listener.ora

此文件位于:

  • Windows:%ORACLE_HOME%\
    etwork\\admin\\listener.ora
  • Linux:$ ORACLE_HOME / network / admin / listener.ora

0.0.0.0

替换localhost

1
2
3
4
5
6
7
8
9
10
11
# ...

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    )
  )

# ...

步骤2-重新启动Oracle服务

  • Windows:WinKey r

    1
    services.msc

  • Linux(CentOs):

    1
    sudo systemctl restart oracle-xe

enter


我也遇到了同样的问题,但是我通过在控制面板->管理工具->服务-> oracle TNS监听器启动中启动TNS监听器解决了这个问题。我正在使用Windows Xp和Toad连接到Oracle。


签出您的TNS名称,该名称在ALIAS的左侧不得有空格

最诚挚的问候


根据oracle在线文档

ORA-12541: TNS:no listener

1
2
3
4
5
6
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.