oracle給用戶分配特定用戶下特定表的只讀權限


以下是測試過程,測試環境oracle 11.2.0.3 linux平台:
模擬將HR用戶下的employees表的只讀權限非配給test_ycr
創建用戶:
SQL> create user test_ycr identified by oracle;
SQL> grant create session to test_ycr;
Grant succeeded.
此時用戶無法選擇employee表:
SQL> conn test_ycr/oracle;
Connected.
SQL> select employee_id from hr.employees;
select employee_id from hr.employees
                           *
ERROR at line 1:
ORA-00942: table or view does not exist
給test_ycr用戶賦予employees表的只讀權限后實現只讀:
SQL> conn / as sysdba
Connected.
SQL> grant select on hr.employees to test_ycr;
Grant succeeded.
SQL> conn test_ycr/oracle
Connected.
SQL> select employee_id from hr.employees where employee_id=206;
EMPLOYEE_ID
-----------
        206
但是無法修改:
SQL> update hr.employees set employee_id=333 where employee_id=206;
update hr.employees set employee_id=333 where employee_id=206
          *
ERROR at line 1:
ORA-01031: insufficient privileges
功能實現。


免責聲明!

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



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