Oracle查看所有用户及其权限
Oracle查看所有用户及其权限:
Oracle数据字典视图的种类分别为:USER,ALL 和 DBA.
USER_*:有关用户所拥有的对象信息,即用户自己创建的对象信息
ALL_*:有关用户可以访问的对象的信息,即用户自己创建的对象的信息加上其他用户创建的对象但该用户有权访问的信息
DBA_*:有关整个数据库中对象的信息
(这里的*可以为TABLES,INDEXES,OBJECTS,USERS等。)
1、查看所有用户
select * from dba_user;
select * from all_users;
select * from user_users;
2、查看用户系统权限
select * from dba_sys_privs;
select * from all_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;
6、查看当前用户的缺省表空间
select username,default_tablespace from user_users;
7、查看某个角色的具体权限
如 grant connect,resource,create session,create view to TEST;
8、查看RESOURCE具有那些权限
SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='RESOURCE
oracle创建用户需要什么权限,Oracle 创建普通用户,并赋予权限
采用sys or system / manager assysdba; 连接数据库。
创建普通用户oadmin: create user oadmin identified by pwd_oracle;
删除用户:
drop user oadmin;
授予用户登录数据库的权限:
grant create session to oadmin;
授予用户操作表空间的权限:
grant unlimited tablespace to oadmin;
grant create tablespace to oadmin;
grant alter tablespace to oadmin;
grant drop tablespace to oadmin;
grant manage tablespace to oadmin;
授予用户操作表的权限:
grant create table to oadmin; (包含有create index权限, alter table, drop table权限)
授予用户操作视图的权限:
grant create view to oadmin; (包含有alter view, drop view权限)
授予用户操作触发器的权限:
grant create trigger to oadmin; (包含有alter trigger, drop trigger权限)
授予用户操作存储过程的权限:
grant create procedure to oadmin;(包含有alter procedure, drop procedure 和function 以及 package权限)
授予用户操作序列的权限:
grant create sequence to oadmin; (包含有创建、修改、删除以及选择序列)
授予用户回退段权限:
grant create rollback segment to oadmin;
grant alter rollback segment to oadmin;
grant drop rollback segment to oadmin;
授予用户同义词权限:
grant create synonym to oadmin;(包含drop synonym权限)
grant createpublicsynonym to oadmin;
grant droppublicsynonym to oadmin;
授予用户关于用户的权限:
grant create user to oadmin;
grant alter user to oadmin;
grant become user to oadmin;
grant drop user to oadmin;
授予用户关于角色的权限:
grant create role to oadmin;
授予用户操作概要文件的权限
grant create profile to oadmin;
grant alter profile to oadmin;
grant drop profile to oadmin;
允许从sys用户所拥有的数据字典表中进行选择
grant select any dictionary to oadmin;
本文来自博客园,作者:花之旭,转载请注明原文链接:https://www.cnblogs.com/huazhixu/p/15788803.html