oracle权限

权限授予:

 

授予登陆权限:grant create sessionto cz;

 

授予查询权限:grant select onscott.emp to cz;

 

授予删除权限:grant delete onscott.emp to cz;

 

授予表空间权限: grant unlimited  tablespace to zx

使用表空间权限:

      Grant unlimited tablespace to 用户名


权限回收:

       Revoke select on 表名 from 用户名


权限传递:

       默认权限不能进行传递

       Grant create sessionto  用户名 with adminoption

       可传递,并且不能被级联删除

       Grant select on 表名 to 用户名 with grantoption

       可传递,能被级联删除


查询所有的系统角色

Select * from dba_roles

查询角色下面所拥有的权限

Select * from role_sys_privs where role=’角色权限名’

Select * from role_tab_privs where role=’角色权限名’

Select * from role_role_privs where role=’角色权限名’


--查询系统权限

 select * fromdba_sys_privs where grantee='MYROLE'

 

 --查询所有的对象权限

 select * fromdba_tab_privs where grantee='MYROLE'

 

 --角色下面所具有的角色

 select * from  role_role_privs whererole = 'MYROLE'

 

 --查询所有的同义词

 select * fromdba_synonyms where synonym_name='EP'

 

 --查询所有的视图

 select * fromdba_views where view_name='VIEW_EMP'


自定义角色

创建自定义角色:create role 角色名

把权限给角色

grantcreate session to myrole;

  把角色给角色

grant 权限名(角色名) to 角色名

 

角色查询: select * from dba_roles whererole='MYROLE'

 

角色系统权限查询:

select * from dba_sys_privs  where grantee='MYROLE'






猜你喜欢

转载自blog.csdn.net/zhangxin97/article/details/78792064