權限授予:
授予登陸權限: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'