最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

ORA-01727view赋权withgrantoption

来源:动视网 责编:小采 时间:2020-11-09 14:56:12
文档

ORA-01727view赋权withgrantoption

ORA-01727view赋权withgrantoption:ORA-01720: grant option does not exist for ORA-01720: grant option does not exist for 'SCOTT.LOCK1' 该问题出现在将view赋权给另外的用户时,而该view中引用了第三个用户下的表。 例如:我有三个用户:scott,roy,test在roy下创
推荐度:
导读ORA-01727view赋权withgrantoption:ORA-01720: grant option does not exist for ORA-01720: grant option does not exist for 'SCOTT.LOCK1' 该问题出现在将view赋权给另外的用户时,而该view中引用了第三个用户下的表。 例如:我有三个用户:scott,roy,test在roy下创


ORA-01720: grant option does not exist for

ORA-01720: grant option does not exist for 'SCOTT.LOCK1'
该问题出现在将view赋权给另外的用户时,而该view中引用了第三个用户下的表。

例如:
我有三个用户:scott,roy,test
在roy下创建一个view引用到scott的表
然后将roy下的view的访问权限给test
如果按普通的赋权模式,此时就会报出ORA-01720错误。

解决方法是:
在将表scott下的表访问权限赋权给roy用户时,加上with grant option。
这样当view赋权给test时就会自动把scott表的权限给test,这样就不会出错了。

实验测试:
环境本地linux RedHat 5, Oracle 11gR2

1.用dba用户登录,先试着创建视图roy.new_view,报错
SQL> connect dbmgr/dbmgr;
Connected.

SQL> create view roy.new_view(id,comm) as select id,comm from scott.lock1;
create view roy.new_view(id,comm) as select id,comm from scott.lock1
*
ERROR at line 1:
ORA-00942: table or view does not exist

2.给roy赋普通权限后,创建视图成功
SQL> grant select on scott.lock1 to roy;

Grant succeeded.

SQL> create view roy.new_view(id,comm) as select id,comm from scott.lock1;

View created.

3.将视图赋权给test用户,报错ORA-01720
SQL> grant select on roy.new_view to test;
grant select on roy.new_view to test
*
ERROR at line 1:
ORA-01720: grant option does not exist for 'SCOTT.LOCK1'

4.给roy赋权时加上with grant option 选项再将视图赋权给test用户,成功
SQL> grant select on scott.lock1 to roy with grant option;

Grant succeeded.

SQL> grant select on roy.new_view to test;

Grant succeeded.

本文永久更新链接地址:

文档

ORA-01727view赋权withgrantoption

ORA-01727view赋权withgrantoption:ORA-01720: grant option does not exist for ORA-01720: grant option does not exist for 'SCOTT.LOCK1' 该问题出现在将view赋权给另外的用户时,而该view中引用了第三个用户下的表。 例如:我有三个用户:scott,roy,test在roy下创
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top