瞭解ORACLE權限管理

 
 
create user myuser identified by mypassword default tablespace users;
/**
請輸入用戶名:  myuser
輸入口令:
ERROR:
ORA-01045: user MYUSER lacks CREATE SESSION privilege; logon denied
創建用戶後,用戶並不能馬上登錄

*/

grant create session to myuser;--分配連接權限後用戶myuser可以正常使用pl/sql
grant create table to myuser;--給用戶myuser分配創建表的權限
alter user myuser quota 100M on users;--給用戶myuser分配USERS表空間
grant create session to myuser with amdin option;--用戶myUser可以將自己的權限往下分
grant create session,create table to myuser;--一次分配多個權限
revoke create session,create table from myuser;--回收用戶權限,使用with admin option 會因傳播者權限變更失效

--對象權限 grant OP_TYPE on OBJECT_NAME to USER;
grant select,insert,update,delete,execute,index,references,alter on emp to myuser;
grant all on emp to myuser;
grant select on emp to myuser with grant option;
revoke update,insert on emp from myuser;

--利用角色分配權限(角色是權限的集合)

create role myrole;
grant select,update to myrole;
grant myrole to to myuser;

--角色繼承
grant roleA to roleB;
--roleB 繼承roleA

 


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章