oracle中的角色

来源:互联网 发布:网络打字员兼职1w300 编辑:程序博客网 时间:2024/06/11 03:44
角色:


1)预定义角色:这里不讲,应该有25种,这些都是系统给事先
定义好的.


2)自定义角色:根据自己的需要来定义.一般是dba来建立,
如果用别的用户来建立,则需要具有create role的系统权限.在
建立角色时可以指定验证方式(不验证,数据库验证等等)


a)建立角色(不验证):


create role 角色名 not identified


b)建立角色(数据库验证)


当激活该角色的时候,必须提供口令,在建立
这种角色时,需要为其提供口令:


create role 角色名 identified by xxx(xxx就是口令)




3)显示角色信息;
a)显示所用角色:
select * from dba_roles


b)显示角色具有的系统权限


select privilege,admin_option from role_sys_privs where


role='角色名';


c)显示角色具有的对象权限


select * from dba_tab_privs


d)显示用户具有的角色,及当前的默认角色
select granted_role,default_role from dba_role_privs where
grantee='用户名'