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;
3.把角色赋予指定账户
create user user identified by user default tablespace xxx;
grant select_role to user;
4.删除角色
drop role select_role;
5.检查角色的权限
select * from dba_sys_privs where grantee=’select_role’
测试权限的时候需要加上用户的对象例如
select count(*) from hr.ex_user;