了解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

 


 

你可能感兴趣的:(了解ORACLE权限管理)