ITPub博客

首页 > 数据库 > Oracle > oracle 用户权限之执行存储过程权限不足

oracle 用户权限之执行存储过程权限不足

原创 Oracle 作者:清风艾艾 时间:2017-06-20 11:11:55 0 删除 编辑

操作系统版本:

[oracle@se31 ~]$ uname -a
Linux se31 3.8.13-44.1.1.el6uek.x86_64 #2 SMP Wed Sep 10 06:10:25 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux
[oracle@se31 ~]$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.6 (Santiago)
[oracle@se31 ~]$ 

数据库版本:

[oracle@se31 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 20 10:52:57 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
SQL> 

今天,开发同事使用drgs执行存储过程包报错权限不足,如下图:

报错提示很明显,就是drgs没有执行存储过程的权限,原因估计是最近数据安全取消了drgs用户的dba权限执行revoke dba from drgs导致的;

回收drgs的dba权限后,需要细粒度赋权限:

[oracle@se31 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 20 09:59:52 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select username from dba_users where username='DRGS';
USERNAME
------------------------------
DRGS
SQL> grant resource to drgs;

Grant succeeded.

SQL> grant create any procedure to drgs;

Grant succeeded.

SQL> grant execute any procedure to drgs;

Grant succeeded.

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@se31 ~]$ 

细粒度赋权限后,经开发同事测试drgs能够正常执行存储过程了。

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

请登录后发表评论 登录
全部评论
个人喜欢IT行业,目前从事数据库工作,包括Oracle、mysql、mongodb、sqlserver等数据库的维护,喜欢专研开发技术,尤其对java程序的开发感兴趣。工作经历上,在中国联通系统集成公司、中公网医疗信息技术有限公司做过数据库技术支持;目前在海量数据,负责华东区oracle、mysql、mongodb的维护工作。

注册时间:2015-01-30

  • 博文量
    251
  • 访问量
    544850