您的位置:首页 > 数据库 > Oracle

oracle赋权问题(如何在一个用户下查询其他用户的表)

2017-08-02 19:53 337 查看
一  以需要被查询的用户登录oracle(假如为A)   B为要查询A用户下的表的用户

二  执行查询语句: select 'grant select on A.'|| tname ||' to  B;' from tab;

以下为模拟结果:

grant select on A.DEPT to  B; 
grant select on A.EMP to  B; 
grant select on A.BONUS to  B; 
grant select on A.SALGRADE to  B; 
grant select on A.AVGSAL to  B; 
grant select on A.BOOK to  B; 
grant select on A.TEST_INDEX to  B;  
grant select on A.TB_EMPLOYEES to  B; 

...

三 将结果复制

四  登录system用户

五 打开sqlwindow ,粘贴,运行。

可以将select换成all就是这些表的所有权限都赋予给B
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐