PL/SQL过程与权限
来源:互联网 发布:javascript网站 编辑:程序博客网 时间:2024/05/02 00:19
最近有个小伙伴问我:一个用户拥有DBA权限,为什么在执行存储过程的时候还会提示找不到表或试图?
我来简单模拟下他所说的情况
首先SCOTT用户拥有DBA权限
SCOTT用户可以正常查看HR用户下的DEPARTMENTS表数据
但是在SCOTT下创建过程时,却提示表或试图不存在,这是为什么呢?
看下官网的解释:
Using Roles with Invoker's Rights Subprograms
The use of roles in a subprogram depends on whether it executes with definer's rights or invoker's rights. Within a definer's rights subprogram, all roles are disabled. Roles are not used for privilege checking, and you cannot set roles.Within an invoker's rights subprogram, roles are enabled (unless the subprogram was called directly or indirectly by a definer's rights subprogram). Roles are used for privilege checking, and you can use native dynamic SQL to set roles for the session. However, you cannot use roles to grant privileges on template objects because roles apply at run time, not at compile time.
简言之,当过程的使用定义者权限的时候,所有的角色都不生效;当使用调用者权限的时候,角色才能够生效。
所以应当显式的授予对象权限,如
grant select on hr.departments to scott 或 grant select any table to scott
- PL/SQL过程与权限
- PL/SQL 过程与函数
- 存储过程与PL/SQL基本用法
- PL/SQL之六过程与函数
- PL/SQL--存储过程与函数
- PL/SQL与存储过程的区别
- PL/SQL中的存储过程与函数
- 用PL/SQL导出表,存储过程,权限等信息
- pl/sql 存储过程
- Pl/sql 学习过程
- PL/SQL --> 存储过程
- PL/SQL存储过程
- PL/SQL存储过程
- Pl/sql 存储过程
- PL/SQL --> 存储过程
- pl/sql 过程、函数
- pl/sql 过程 函数
- ORACLE PL/SQL编程存储过程与函数
- poj 2762 Going from u to v or from v to u? (判断是否是弱联通图)
- leetcode: Search in Rotated Sorted Array II
- SQL注入攻击与防御(第2版)_读书笔记2_未完待续
- 我的第3篇博客
- 引蜘蛛引得好嗨
- PL/SQL过程与权限
- 关于异常Dex Loader:Unable to execute dex: Multiple dex files的处理
- Pku1218
- ios-block详解
- 第4篇博客 与大家分享一组数据
- K-th Number (划分树学习)
- vs2010 VC++ 无法打开包括文件 hidsdi.h
- 一些Android开发的基本问题
- POJ_2393_Yogurt factory