本文介绍了Oracle 客户端 ORA-12541:TNS:无侦听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

错误:ORA-12541: TNS: 没有侦听器

我的数据库是 Oracle 10gR2

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

解决方案

需要设置oracle监听所有ip地址(默认只监听localhost连接)

步骤 1 - 编辑 listener.ora

该文件位于:

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

替换 localhost with 0.0.0.0

# ...听者 =(DESCRIPTION_LIST =(描述 =(地址 = (协议 = IPC)(密钥 = EXTPROC1521))(地址 = (协议 = TCP)(主机 = 0.0.0.0)(端口 = 1521))))# ...

第 2 步 - 重启 Oracle 服务

  • Windows: +

    services.msc

  • Linux (CentOs):

    sudo systemctl restart oracle-xe

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:

My database is Oracle 10gR2

So how can I solve this issue?

解决方案

You need to set oracle to listen on all ip addresses (by default, it listens only to localhost connections.)

Step 1 - Edit listener.ora

This file is located in:

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

Replace localhost with 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

  • Windows: +

    services.msc
    

  • Linux (CentOs):

    sudo systemctl restart oracle-xe
    

这篇关于Oracle 客户端 ORA-12541:TNS:无侦听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 10:41