微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

错误 TNS-12541:TNS:没有侦听器,但 Windows TNS 侦听器服务已启动

如何解决错误 TNS-12541:TNS:没有侦听器,但 Windows TNS 侦听器服务已启动

不知何故,当没有修改任何 Oracle 服务器文件时,我们的数据库实例无法连接到数据库实例,如下所示:

数据库实例:UP,监听器:DOWN,到实例的代理连接:DOWN

版本为 Oracle Database 11g 第 2 版 (11.2.0.1)

当使用 sql plus 运行此命令时:

select value from v$parameter where name='service_names';

输出为:orcl1

这是我的 listener.ora (D:\Oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN):

LISTENER =
 (DESCRIPTION_LIST =
  (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST = XXXDS1)(PORT = 1521))
   (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  )
 )
ADR_BASE_LISTENER = c:\Oracle

tnsnames.ora :

ORCL1 =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.12)(PORT = 1521))
  (CONNECT_DATA =
   (SERVER = DEDICATED)
   (SID = ORCL1)
   (SERVICE_NAME = ORCL1)
  )
 )

出现第一个错误的log.xml :

<msg time='2021-02-20T09:19:24.203+07:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNowN' level='16' host_id='XXXDS1'
 host_addr='::1'>
 <txt>20-FEB-2021 09:19:24 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=XXXDS1$))(SERVICE_NAME=orcl1)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.12)(PORT=56955)) * establish * orcl1 * 12560
 </txt>
</msg>
<msg time='2021-02-20T09:19:34.343+07:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNowN' level='16' host_id='XXXDS1'
 host_addr='::1'>
 <txt>TNS-12560: TNS:protocol adapter error
 TNS-00530: Protocol adapter error
 64-bit Windows Error: 53: UnkNown error
  TNS-12518: TNS:listener Could not hand off client connection
  TNS-12571: TNS:packet writer failure
   TNS-12560: TNS:protocol adapter error
   TNS-00530: Protocol adapter error
    64-bit Windows Error: 54: UnkNown error
 </txt>
</msg>

来自 log.xml 的另一个错误

<msg time='2021-02-20T10:51:15.390+07:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNowN' level='16' host_id='XXXDS1'
 host_addr='::1'>
 <txt>20-FEB-2021 10:51:15 * (CONNECT_DATA=(SID=orcl1)(CID=(PROGRAM=D:\Oracle\product\11.2.0\dbhome_1\bin\emagent.exe)(HOST=XXXDS1)(USER=SYstem))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.12)(PORT=49401)) * establish * orcl1 * 12505
 </txt>
</msg>
<msg time='2021-02-20T10:51:25.514+07:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNowN' level='16' host_id='XXXDS1'
 host_addr='::1'>
 <txt>TNS-12505: TNS:listener does not currently kNow of SID given in connect descriptor
 </txt>
</msg>
<msg time='2021-02-20T10:51:42.490+07:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNowN' level='16' host_id='XXXDS1'
 host_addr='::1'>
 <txt>20-FEB-2021 10:51:35 * (CONNECT_DATA=(SID=orcl1)(CID=(PROGRAM=D:\Oracle\product\11.2.0\dbhome_1\perl\bin\perl.exe)(HOST=XXXDS1)(USER=SYstem))) * (ADDRESS=(PROTOCOL=tcp)(HOST=::1)(PORT=49406)) * establish * orcl1 * 12505
 </txt>
</msg>
<msg time='2021-02-20T10:51:52.614+07:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNowN' level='16' host_id='XXXDS1'
 host_addr='::1'>
 <txt>TNS-12505: TNS:listener does not currently kNow of SID given in connect descriptor
 </txt>
</msg>
<msg time='2021-02-20T10:52:02.738+07:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNowN' level='16' host_id='XXXDS1'
 host_addr='::1'>
 <txt>20-FEB-2021 10:52:02 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=XXXDS1$))(SERVICE_NAME=orcl1)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.12)(PORT=49408)) * establish * orcl1 * 12514
 </txt>
</msg>
<msg time='2021-02-20T10:52:12.862+07:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNowN' level='16' host_id='XXXDS1'
 host_addr='::1'>
 <txt>TNS-12514: TNS:listener does not currently kNow of service requested in connect descriptor
 </txt>
</msg>

来自 log.xml 的另一个错误

<msg time='2021-02-20T10:53:40.705+07:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNowN' level='16' host_id='XXXDS1'
 host_addr='::1'>
 <txt>TNS-12571: TNS:packet writer failure
 TNS-12560: TNS:protocol adapter error
 TNS-00530: Protocol adapter error
  64-bit Windows Error: 54: UnkNown error
  TNS-12514: TNS:listener does not currently kNow of service requested in connect descriptor
 </txt>
</msg>
<msg time='2021-02-20T10:53:50.844+07:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNowN' level='16' host_id='XXXDS1'
 host_addr='::1'>
 <txt>Dynamic address is already listened on (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XXXDS1.xxxad.local)(PORT=1521)))
 </txt>
</msg>

这些错误被多次写入

lsnrctl 状态为 READY

这种情况怎么会突然发生以及如何解决

真诚的

奥维迪延托

解决方法

好的,我找到了答案

我的 listener.log 文件是 4Gb。所以我更改了文件名,重新启动服务,它就可以工作了。 打开企业管理器时的速度性能也有所提高。

谢谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。