oracle 授權用戶訪問指定視圖


  

--創建用戶 test_user ,並授權 連接,查詢視圖
create user test_user identified by test_user;
grant connect to test_user;
grant create view to test_user;

--授權視圖引用的表權限給新用戶
grant select on other_user.table1 to test_user with grant option;
grant select on other_user.table2 to test_user with grant option;
grant select on other_user.table3 to test_user with grant option;

-- 使用新用戶 test_user 創建相關視圖
create or replace view v_1 as
select a.*,b.*,c.* from  other_user.table1 a
join other_user.table2 b on a.id=b.fid
join other_user.table3 c on b.fid=c.xid

-- 移出新用戶創建視圖的權限
revoke create view from test_user;

 

繞了很多彎路,記錄一下


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM