oracle普通用户创建和加权限

普通用户床架和加权限

create user test1 identified by test1;

grant connect to test1;
grant resource to test1;
grant create snapshot to test1;
grant create synonym to test1;
grant create view to test1;
grant select any table to test1;
grant create any trigger to test1;
grant create any view to test1;
grant select any dictionary to test1;

grant unlimited tablespace to test1;


查看角色拥有的权限

select grantee,privilege from dba_sys_privs where grantee='RESOURCE' order by privilege;

CONNECT角色:    –是授予最终用户的典型权利,最基本的      
   CREATE    SESSION    –建立会话 

RESOURCE角色:    –是授予开发人员的     
   CREATE    CLUSTER         –建立聚簇  
   CREATE    PROCEDURE    –建立过程  
   CREATE    SEQUENCE      –建立序列  
   CREATE    TABLE              –建表  
   CREATE    TRIGGER          –建立触发器  
   CREATE    TYPE                –建立类型
   CREATE    OPERATOR       –创建操作者
   CREATE    INDEXTYPE      –创建索引类型
   CREATE    TABLE              –创建表


1.查看所有用户:
  select * from dba_users;
  select * from all_users;
  select * from user_users;
2.查看用户或角色系统权限:
  select * from dba_sys_privs;
  select * from user_sys_privs;
3.查看用户对象权限:
  select * from dba_tab_privs;
  select * from all_tab_privs;
  select * from user_tab_privs;
4.查看所有角色:
  select * from dba_roles;
5.查看用户或角色所拥有的角色:
  select * from dba_role_privs;
  select * from user_role_privs;

 

 

注意:

1、以下语句可以查看Oracle提供的系统权限

select name from sys.system_privilege_map

 

2、查看一个用户的所有系统权限(包含角色的系统权限)


select privilege from dba_sys_privs where grantee='DATAUSER'  
union  
select privilege from dba_sys_privs where grantee in (select granted_role from dba_role_privs where grantee='DATAUSER' ); 


参考:

http://www.2cto.com/database/201408/322396.html



你可能感兴趣的:(oracle)