ORACLE权限管理-创建只读账号

创建只读用户:
grant connect to user;

grant create session to user;

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;
3.把角色赋予指定账户
grant SELECT_ROLE to user;
4.删除角色
drop role SELECT_ROLE;

5:查询

select * from dba_sys_privs WHERE GRANTEE='SELECT_ROLE';
select * from role_sys_privs WHERE ROLE='SELECT_ROLE';
select * from dba_tab_privs WHERE GRANTEE='SELECT_ROLE';

创建读存储过程的用户
1:创建角色
CREATE ROLE DEBUG_PROCEDURE
2:给角色分配权限
grant EXECUTE ANY PROCEDURE to DEBUG_PROCEDURE;
grant CREATE ANY PROCEDURE to DEBUG_PROCEDURE;
grant DEBUG ANY PROCEDURE to DEBUG_PROCEDURE;
3.把角色赋予指定账户
grant DEBUG_PROCEDURE TO user;

posted on 2018-07-27 15:40  HelonTian  阅读(754)  评论(0编辑  收藏  举报