系统:CentOS7.9 数据库:Oracle11.2.0.4 问题描述:查看监听状态时发现报错TNS-01189. Change:此前修改过主机名. [grid@dbserver~]$ lsnrctl status LSNRCTLfor Linux: Version 11.2.0.4.0 - Production on 21-AUG-2022 12:03:57 Copyright(c) 1991, 2013, Oracle. All rightsreserved. Connectingto (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 Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hisserver)(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 localhost4localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6localhost6.localdomain6 192.168.133.191dbserver 192.168.133.196hisserver.sztech.com hisserver [grid@dbserveradmin]$ 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 = hisserver)(PORT = 1521)) ) ) ADR_BASE_LISTENER= /u01/app/grid ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent 如上,发现监听文件中“HOST = hisserver”,将其修改为“HOST= dbserver”. 此后监听恢复正常,监听进程通过ps命令也能正常显示. [grid@dbserveradmin]$ 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
|