欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

如何创建只读权限oracle账户

程序员文章站 2022-05-02 12:58:26
1.创建角色 CREATE ROLE SELECT_ROLE 2.给角色分配权限 grant CREATE VIEW to SELECT_ROLE; grant CREATE SYNONYM to SELECT_ROLE; grant CONNECT TO SELECT_ROLE;grant SEL ......

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;