1.建立角色
CREATE ROLE SELECT_ROLE
2.給角色分配權限測試
grant CREATE VIEW to SELECT_ROLE;
grant CREATE SYNONYM to SELECT_ROLE; 對象
grant CONNECT TO SELECT_ROLE;
grant SELECT ANY DICTIONARY to SELECT_ROLE;
grant SELECT ANY TABLE to SELECT_ROLE;
grant SELECT ANY TRANSACTION to SELECT_ROLE;
grant SELECT ANY SEQUENCE to SELECT_ROLE;select
3.把角色賦予指定帳戶 權限
CREATE USER user IDENTIFIED BY user DEFAULT TABLESPACE xxx;
grant SELECT_ROLE to user;
4.刪除角色
drop role SELECT_ROLE;db
5.檢查角色的權限
select * from dba_sys_privs where grantee='SELECT_ROLE'dba
測試權限的時候須要加上用戶的對象例如
select count(*) from hr.ex_user;ant