[Oracle工程师手记]解决listener 的 TNS-12545 错误
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了[Oracle工程师手记]解决listener 的 TNS-12545 错误,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含6411字,纯文字阅读大概需要10分钟。
内容图文
![[Oracle工程师手记]解决listener 的 TNS-12545 错误](/upload/InfoBanner/zyjiaocheng/446/d89166712daf4cf695527f8a90b82001.jpg)
现象: 执行 lsnrctl start 来启动 listener,却失败了。
$ lsnrctl stat LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 09-APR-2021 23:45:02 Copyright (c) 1991, 2019, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hst15574.mytst.com)(PORT=1521))) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 111: Connection refused Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 2: No such file or directory $
$ lsnrctl start LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 09-APR-2021 23:45:08 Copyright (c) 1991, 2019, Oracle. All rights reserved. Starting /refresh/home/app/oracle/product/19.3.0/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 19.0.0.0.0 - Production System parameter file is /refresh/home/app/oracle/product/19.9.0/network/admin/listener.ora Log messages written to /refresh/home/app/oracle/diag/tnslsnr/hst06027/listener/alert/log.xml Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hst15574.mytst.com)(PORT=1521))) TNS-12545: Connect failed because target host or object does not exist TNS-12560: TNS:protocol adapter error TNS-00515: Connect failed because target host or object does not exist Linux Error: 99: Cannot assign requested address Listener failed to start. See the error message(s) above...
检查 host 文件,没有发现有什么问题。
$ $ cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 $
再看 listener.ora 文件:
[oracle@hst06027 admin]$ cat /refresh/home/app/oracle/product/19.9.0/network/admin/listener.ora # listener.ora Network Configuration File: /refresh/home/app/oracle/product/19.9.0/network/admin # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = hst15574.mytst.com)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )
再看hostname 的结果:
[oracle@hst06027 admin]$ cat /refresh/home/app/oracle/product/19.9.0/network/admin/listener.ora # listener.ora Network Configuration File: /refresh/home/app/oracle/product/19.9.0/network/admin # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = hst15574.mytst.com)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )
由于曾经改变了主机名,所以,listener.ora 中的主机名和 hostname 中的名字不同,导致无法运行listener。需要编辑修改 listener.ora :
$ vi /refresh/home/app/oracle/product/19.9.0/network/admin/listener.ora
确认:
$ cat /refresh/home/app/oracle/product/19.9.0/network/admin/listener.ora # listener.ora Network Configuration File: /refresh/home/app/oracle/product/19.9.0/network/admin # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = hst06027.mytst.com)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )
再次启动,发现可以成功了。
[oracle@hst06027 admin]$ lsnrctl start LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 09-APR-2021 23:49:25 Copyright (c) 1991, 2019, Oracle. All rights reserved. Starting /refresh/home/app/oracle/product/19.3.0/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 19.0.0.0.0 - Production System parameter file is /refresh/home/app/oracle/product/19.9.0/network/admin/listener.ora Log messages written to /refresh/home/app/oracle/diag/tnslsnr/hst06027/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hst06027.mytst.com)(PORT=1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hst06027.mytst.com)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 09-APR-2021 23:49:26 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /refresh/home/app/oracle/product/19.9.0/network/admin/listener.ora Listener Log File /refresh/home/app/oracle/diag/tnslsnr/hst06027/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hst06027.mytst.com)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) The listener supports no services The command completed successfully
等待两三分钟,确认 listener 的状态:
[oracle@hst06027 admin]$ lsnrctl stat LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 09-APR-2021 23:51:26 Copyright (c) 1991, 2019, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hst06027.mytst.com)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 09-APR-2021 23:49:26 Uptime 0 days 0 hr. 2 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /refresh/home/app/oracle/product/19.9.0/network/admin/listener.ora Listener Log File /refresh/home/app/oracle/diag/tnslsnr/hst06027/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hst06027.mytst.com)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "86b637b62fdf7a65e053f706e80a27ca" has 1 instance(s). Instance "db193cdb", status READY, has 1 handler(s) for this service... Service "appcon1" has 1 instance(s). Instance "db193cdb", status READY, has 1 handler(s) for this service... Service "apppdb1" has 1 instance(s). Instance "db193cdb", status READY, has 1 handler(s) for this service... Service "apppdb2" has 1 instance(s). Instance "db193cdb", status READY, has 1 handler(s) for this service...
[Oracle工程师手记]解决listener 的 TNS-12545 错误
标签:etc prot tns-12545 sts instance 解决 bin alert erro
本文系统来源:https://www.cnblogs.com/gaojian/p/14639499.html
内容总结
以上是互联网集市为您收集整理的[Oracle工程师手记]解决listener 的 TNS-12545 错误全部内容,希望文章能够帮你解决[Oracle工程师手记]解决listener 的 TNS-12545 错误所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。