【ORA-01720】grant option does not exist for 'string.string'

今天做测试发布的时候发现在给一个用户赋予一个视图的select权限的时候报1720错误,现总结下。

视图授权:

e.g.

用户A存在表t1,t2

用户B下存在视图v1(v1是根据t1、t2创建的)

需要给用户C授权v1视图的访问权限。

一般我们就直接给用户B select权限,如下:

grant select on t1 to B;

grant select on t2 to B;

但是,要想给用户C授权v1视图的访问权限,那么首先用户B需要有授权t1、t2的权限!

因此:

grant select on t1 to B with grant option;    

grant select on t2 to B with grant option;    

执行了上述语句,用户B才有授权v1给用户C的能力。

如果不按上面的注意事项操作,则会在用户B授权视图的时候,报错:

ORA-01720 grant option does not exist for 'string.string'

Cause: A grant was being performed on a view and the grant option was not present for an underlying object.

Action: Obtain the grant option on all underlying objects of the view.

最后,用户B将v1的读取权限授权给用户C。

grant select on v1 to C;


另:

创建同义词:

create synonym u1.t1 for t1;

存储过程包授权:

grant execute on p1 to u1;

表授权:

grant select on t1 to u1;


你可能感兴趣的:(oracle,view,grant)