给某一个用户分配select 权限
1.创建角色
--CREATE ROLE SELECT_ROLE;
2.给角色分配权限
--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;
2-1.创建用户:
--create user BigData_Select_NC identified by NCSelectRole; --grant connect,resource to BigData_Select_NC;
3.把角色赋予指定账户
--grant SELECT_ROLE to BigData_Select_NC;
4.删除角色
--drop role SELECT_ROLE;
5.检查角色的权限
--select * from dba_sys_privs where grantee='SELECT_ROLE'
6.测试权限的时候需要加上用户的对象例如
--select count(*) from hr.ex_user;
文章评论