停止监听时报错:
SNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.197)(PORT=1521)))
TNS-01190: The user is not authorized to execute the requested listener command
LSNRCTL> start
TNS-01106: Listener using listener name LISTENER has already been started
LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.197)(PORT=1521)))
TNS-01190: The user is not authorized to execute the requested listener command
参考《TNS-01190: The user is not authorized to execute the requested listener command》
中一段官方文档的描述:
TNS-01190: The user is not authorized to execute the requested
listener command Cause: Most of the listener administrative commands
are only intended to be issued by privileged users, for example DBAs
or system administrators. If the listener password is not set, then
the listener only accepts administrative requests from LSNRCTL running
with the same OS credentials, or running as a local administrator
(also referred to as super user). Action: If an authorized user is
attempting the command, then make sure that LSNRCTL is executed with
the same OS user credentials as the running listener, or as a local
administrator.
我碰到的问题就是当前用户权限不够引起(running as a local administrator
),发现切换到root用户一样的错误,直接查看监听文档的权限:
[root@localhost oracle]# ll /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-rw-r--r--. 1 oracle oinstall 663 Mar 7 07:07 /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
发现确实是有问题的,修改下权限
[root@localhost oracle]# chmod -R 775 /u01
[root@localhost oracle]# ll /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
-rwxrwxr-x. 1 oracle oinstall 663 Mar 7 07:07 /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
用root用户停止监听不报错,Oracle用户继续报错,那就是第二个原因了make sure that LSNRCTL is executed with the same OS user credentials as the running listener
,当时启动用的用户是root导致的。记得使用统一用户启动和关闭。