TNS-01190: The user is not authorized to execute the requested listener command

2014.9.25 11:33

开发的请求在重启测试环境的的库,秉着重启数据库的官方标准
1、关闭监听
2、关闭数据库
3、打开数据库
4、开启监听
一般都是Oracle用户去操作这些。但是在lsnrctl stop 时报错:

[oracle@DEVEDW ~]$ lsnrctl stop 

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 25-SEP-2014 11:22:46

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(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  

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.  
大概意思就是确定执行操作的用户是不是DBA或者管理员,说白了就是有木有权限来执行。  
网上找了一下发现有如下情况:  
1、权限问题  
2、修改过端口  

解决方案:  
第一种情况:  
授予Oracle用户权限即可  
chown -R oracle.oinstall / ----------》安装目录 ORACLE_HOME  
chmod -R 775 /   为了安全,只要给到可以启动即可。  

第二种情况:  
因为数据库是11.2.0.3而且使用了oracle restart特性且用户为grid.注册了listener服务且只对默认端口1521有效.之前是1522所以oracle restart不会自动重启监听.由于将端口修改成了1521所以oracle restart自动重启了listener  
 [grid@DEVEDW~]$ srvctl status listener  
Listener LISTENER is enabled  
Listener LISTENER is running on node(s): DEVEDW      
由于Oracle restart 以grid用户自动启动了监听所以oracle用户不能重动由grid用户所启动的监听。
故可以切换到grid 用户去执行lsnrctl 操作
 

[oracle@DEVEDW home]$ su - grid
Password:
[grid@DEVEDW ~]$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 25-SEP-2014 11:24:49

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully





上一篇:Uploading File using Ajax and receiving binary data in Asp.net (C#)[转]


下一篇:用SCSS需要小心IE对css的几个限制