PL\SQL 打开时出现"动态执行表不可访问,本会话的自动统计被禁止"错误解决

 

最近做J2ee开发的时候使用PL/SQL,但是每次第一次打开表的时候会提示"动态执行表不可访问,本会话的自动统计被禁止"的错误,一消息如下: V$SESSION,V$SESSTAT,V$STATNAME没有被授权,没有权限访问这几张表,所以没有本法进行统计.当然要给授权了.授权SQL如下:

grant select on v_$statname to user with grant option;
grant select on v_$sesstat to user with grant option;
grant select on v_$session touser with grant option;
grant select on v_$mystat to user with grant option;


user就是要被授权的用户名.记下以备后用.据说给视图授权时要加上with grant option,也就是允许连带授权。

当对user授权了视图时,该用户要查询该视图,必须在视图前加上owner.视图名,要不然会报“表或视图不存在”错误。建同义词,可以解决此问题。

还要给存储过程授权:

grant execute on p_arraymobile2 to yxclient with grant option;
grant execute on p_main2_mx to yxclient with grant option;
grant execute on p_mx_sended to yxclient with grant option;
grant execute on p_wg_fmsg to yxclient with grant option;

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值