create or replace view ORA-01031: 权限不足(转)

来源:互联网 发布:spss软件使用方法文字 编辑:程序博客网 时间:2024/06/02 02:54
情况如下: 我想在A用户下
create or replace view v_test
as select tab1.*,b.tab2.* from tab1,b.tab2 where tab1.id=b.tab2.id;
其中tab1是A用户下的表,tab2是B用户下的表,A用户是赋予了DBA角色的
现在执行create view会提示错误
ORA-01031: 权限不足单独 select tab1.*,b.tab2.* from tab1,b.tab2 where tab1.id=b.tab2.id;和create table tab_testas select tab1.*,b.tab2.* from tab1,b.tab2 where tab1.id=b.tab2.id;是没有问题的
当grant select any table to a;以后就不会提示错误了
很奇怪,为什么会这样呢?grant dba to A;使用这个命令不是授给用户A所有DBA权限吗?后续:

这个问题在8i中是不存在的,在8i中grant dba to a;后,用户 a 就继承了 dba 的privilege,可以select any table了,也能用dba角色具有的其他privilege。在9i 中当grant dba to a;后用户 a 并没有完全继承 dba 的所有privilege ,当需要select any table的时候需要单独grant select any table to a;

转自:http://bdcwl.blog.163.com/blog/static/7652226520108170403946/

0 0
原创粉丝点击