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




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26736162/viewspace-2137249/,如需转载,请注明出处,否则将追究法律责任。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AiDBA宝典

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值