当前位置:Gxlcms > 数据库问题 > oracle 授权用户访问指定视图

oracle 授权用户访问指定视图

时间:2021-07-01 10:21:17 帮助过:126人阅读

  

  1. --创建用户 test_user ,并授权 连接,查询视图
  2. create user test_user identified by test_user;
  3. grant connect to test_user;
  4. grant create view to test_user;
  5. --授权视图引用的表权限给新用户
  6. grant select on other_user.table1 to test_user with grant option;
  7. grant select on other_user.table2 to test_user with grant option;
  8. grant select on other_user.table3 to test_user with grant option;
  9. -- 使用新用户 test_user 创建相关视图
  10. create or replace view v_1 as
  11. select a.*,b.*,c.* from other_user.table1 a
  12. join other_user.table2 b on a.id=b.fid
  13. join other_user.table3 c on b.fid=c.xid
  14. -- 移出新用户创建视图的权限
  15. revoke create view from test_user;

 

绕了很多弯路,记录一下

oracle 授权用户访问指定视图

标签:ora   connect   查询   option   log   视图   highlight   记录   use   

人气教程排行