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

2023-09-19数据库问题
6

本文介绍了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:WinKey + r

    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:

ERROR:
ORA-12541: TNS:no listener

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: WinKey + r

    services.msc
    

  • Linux (CentOs):

    sudo systemctl restart oracle-xe
    

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

The End

相关推荐

SQL 子句“GROUP BY 1"是什么意思?意思是?
What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)...
2024-04-16 数据库问题
62

为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同
Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)...
2024-04-16 数据库问题
13

如何在MySQL中为每个组选择第一行?
How to select the first row for each group in MySQL?(如何在MySQL中为每个组选择第一行?)...
2024-04-16 数据库问题
13

MySQL - 获取最低值
MySQL - Fetching lowest value(MySQL - 获取最低值)...
2024-04-16 数据库问题
8

在 cmakelist.txt 中添加和链接 mysql 库
Add and link mysql libraries in a cmakelist.txt(在 cmakelist.txt 中添加和链接 mysql 库)...
2024-04-16 数据库问题
41

考勤数据库的良好数据库设计(架构)是什么?
What is a good database design (schema) for a attendance database?(考勤数据库的良好数据库设计(架构)是什么?)...
2024-04-16 数据库问题
7