用户、权限和角色

2017-12-14  本文已影响0人  孙竞博

用户与权限

练习1.1 创建一个用户wangkai,并给予10M表空间。

create user wangkai IDENTIFIED by wangkai
quota 10m on users

1.2 使用管理员账户为用户wangkai分配create session和create table的权限。

grant create session to wangkai;
grant create table to wangkai
alter user wangkai IDENTIFIED by wowangkai
alter user wangkai password expire

账户锁定/解锁

alter user wangkai account lock|unlock

回收权限

drop user wangkai [cascade]
revoke create session from wangkai

将对象权限给用户

grant select on scott.emp to wangkai

角色

create role tr;
grant create sequence to tr;
grant tr to wangkai
revoke tr from wangkai;
revoke create sequence from tr;
drop role tr
select * from DBA_SYS_PRIVS
where grantee='DBA';
select * from DBA_SYS_PRIVS
where grantee='CONNECT';
select * from DBA_SYS_PRIVS
where grantee='RESOURCE';
上一篇下一篇

猜你喜欢

热点阅读