意见箱
恒创运营部门将仔细参阅您的意见和建议,必要时将通过预留邮箱与您保持联络。感谢您的支持!
意见/建议
提交建议

TNS-01189 告警

来源:恒创科技 编辑:恒创科技编辑部
2023-12-06 10:39:59

系统:CentOS 7.9

数据库:Oracle 11.2.0.4

问题描述:查看监听状态时发现报错TNS-01189.


TNS-01189 告警

Change:此前修改过主机名.

[grid@dbserver ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-AUG-2022 12:03:57

Copyright (c) 1991, 2013, Oracle. All rights reserved.

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=leo)(PORT=1521)))

TNS-01189: The listener could not authenticate the user

通过ps命令未见监听进程:

[grid@dbserver ~]$ ps -ef|grep tns

root 29 2 0 11:58 ? 00:00:00 [netns]

grid 3784 2608 0 12:05 pts/0 00:00:00 grep --color=auto tns

通常造成TNS-01189有以下两个原因:

a、/etc/hosts文件中IP与主机名不一致

b、listener.ora文件中监听主机并非当前主机

解决方案

查看hosts、listener.ora文件.

[grid@dbserver ~]$ cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.133.191 dbserver

192.168.133.196 leo.sztech.com leo

[grid@dbserver admin]$ cat listener.ora

# listener.ora Network Configuration File: /u01/app/grid/product/11.2.0/grid/network/admin/listener.ora

# Generated by Oracle configuration tools.

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

(ADDRESS = (PROTOCOL = TCP)(HOST = leo)(PORT = 1521))

)

)

ADR_BASE_LISTENER = /u01/app/grid

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent

如上,发现监听文件中“HOST = leo”,将其修改为“HOST = dbserver”.

此后监听恢复正常,监听进程通过ps命令也能正常显示.

[grid@dbserver admin]$ ps -ef |grep tns

root 29 2 0 11:58 ? 00:00:00 [netns]

grid 3820 1 0 12:06 ? 00:00:00 /u01/app/grid/product/11.2.0/grid/bin/tnslsnr LISTENER -inherit

grid 5067 2608 0 12:14 pts/0 00:00:00 grep --color=auto tns

参考网址:

​​https://blog.csdn.net/p6620582/article/details/121147355​​

上一篇: mysql直接拷贝data目录下数据库源文件还原数据库方法 下一篇: Oracle-rac开启数据库归档