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.查看角色(仅仅能查看登陆用户拥有的角色)所包括的权限

sql>select * from role_sys_privs;

4.查看用户对象权限:

  select * from dba_tab_privs;

  select * from all_tab_privs;

  select * from user_tab_privs;

5.查看全部角色:

  select * from dba_roles;

6.查看用户或角色所拥有的角色:

  select * from dba_role_privs;

  select * from user_role_privs;

7.查看哪些用户有sysdba或sysoper系统权限(查询时须要对应权限)

    SQL> select * from dba_role_privs where grantee='CX_ZJ_ROS';                  -------------用户所拥有的角色

  GRANTEE      GRANTED_ROLE   ADM  DEF

  ----------  --------------- ----- ----

  CX_ZJ_ROS ZHRO NO  YES

SQL> SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='ZHRO';       --------这里查询的是用户和自己定义角色所拥有的权限                                                                      

GRANTEE   PRIVILEGE      ADM

-------- ------------ -------------------

ZHRO   CREATE SEQUENCE   NO

ZHRO   CREATE SESSION    NO

ZHRO    CREATE TABLE     NO

ZHRO   UNLIMITED TABLESPACE  NO

5 rows selected.

------------这里的UNLIMITED TABLESPACE权限事实上是不能通过角色的方式授予的

SQL> select * from role_sys_privs where role='CONNECT';    

-------这里查询的是系统角色所拥有的权限

ROLE       PRIVILEGE        ADM

--------- ---------------- ----------

CONNECT    CREATE SESSION   NO

SQL> SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='ILOG_RTS';

GRANTEE    PRIVILEGE             ADM

--------- --------------------- -------------

ILOG_RTS   UNLIMITED TABLESPACE  NO

SQL> select * from dba_role_privs where grantee='ILOG_RTS';

GRANTEE    GRANTED_ROLE        ADM DEF

---------- -------------       --- ---

ILOG_RTS   CONNECT              NO  YES

ILOG_RTS    RESOURCE            NO  YES

select * from V$PWFILE_USERS

TABLE_NAME            COMMENTS

-----------------   -------------------------------------

DBA_CONNECT_ROLE_GRANTEES      Information regarding which users are granted CONNECT

DBA_ROLES                      All Roles which exist in the database

DBA_ROLE_PRIVS                 Roles granted to users and roles

DBA_SCHEDULER_JOB_ROLES        All scheduler jobs in the database by database role

USER_ROLE_PRIVS                Roles granted to current user

ROLE_ROLE_PRIVS                Roles which are granted to roles

ROLE_SYS_PRIVS                 System privileges granted to roles

ROLE_TAB_PRIVS                 Table privileges granted to roles

SESSION_ROLES                  Roles which the user currently has enabled.





TABLE_NAME               COMMENTS

-------------------     -------------------------------------

DBA_AQ_AGENT_PRIVS

DBA_COL_PRIVS                  All grants on columns in the database

DBA_ROLE_PRIVS                 Roles granted to users and roles

DBA_RSRC_CONSUMER_GROUP_PRIVS  Switch privileges for consumer groups

DBA_RSRC_MANAGER_SYSTEM_PRIVS  system privileges for the resource manager

DBA_SYS_PRIVS                  System privileges granted to users and roles

DBA_TAB_PRIVS                  All grants on objects in the database

USER_COL_PRIVS                 Grants on columns for which the user is the owner, grantor or grantee

USER_COL_PRIVS_MADE            All grants on columns of objects owned by the user

    USER_COL_PRIVS_RECD            Grants on columns for which the user is the grantee

USER_ROLE_PRIVS                Roles granted to current user

USER_RSRC_CONSUMER_GROUP_PRIVS Switch privileges for consumer groups for the user

USER_RSRC_MANAGER_SYSTEM_PRIVS system privileges for the resource manager for the user

USER_SYS_PRIVS                 System privileges granted to current user

USER_TAB_PRIVS                 Grants on objects for which the user is

                               the owner, grantor or grantee

USER_TAB_PRIVS_MADE            All grants on objects owned by the user

USER_TAB_PRIVS_RECD            Grants on objects for which the user is the grantee

ALL_COL_PRIVS                  Grants on columns for which the user is

                               the grantor, grantee, owner,or an enabled role or PUBLIC is the grantee



ALL_COL_PRIVS_MADE             Grants on columns for which the user is owner or grantor

ALL_COL_PRIVS_RECD             Grants on columns for which the user, PUBLIC or enabled role is the grantee

ALL_TAB_PRIVS                  Grants on objects for which the user is the grantor, grantee,


                               owner,or an enabled role or PUBLIC is the grantee



ALL_TAB_PRIVS_MADE             User's grants and grants on user's objects

ALL_TAB_PRIVS_RECD             Grants on objects for which the user, PUBLIC or enabled role is the grantee

ROLE_ROLE_PRIVS                Roles which are granted to roles

ROLE_SYS_PRIVS                 System privileges granted to roles

ROLE_TAB_PRIVS                 Table privileges granted to roles

SESSION_PRIVS                  Privileges which the user currently hasset

GV$ENABLEDPRIVS                Synonym for GV_$ENABLEDPRIVS

V$ENABLEDPRIVS                 Synonym for V_$ENABLEDPRIVS



set linesize 120

col username for a20

col ACCOUNT_STATUS for a30

col CREATED for a30

set pagesize 600

col DEFAULT_TABLESPACE for a30

select username,ACCOUNT_STATUS,CREATED,DEFAULT_TABLESPACE from dba_users order by CREATED,ACCOUNT_STATUS;





col GRANTEE for a30

col GRANTED_ROLE for a30

col ADMIN_OPTION for a20

col DEFAULT_ROLE for a20

-------------这里查询的是用户角色所拥有的角色

select * from dba_role_privs where grantee in (select username from dba_users where username not in ('SYS','SYSTEM') AND ACCOUNT_STATUS='OPEN') order by GRANTEE,GRANTED_ROLE;

-------------这里查询的是用户和自己定义角色所拥有的权限

select distinct GRANTEE,PRIVILEGE,ADMIN_OPTION from (SELECT GRANTEE,PRIVILEGE,ADMIN_OPTION FROM DBA_SYS_PRIVS WHERE GRANTEE in (select GRANTED_ROLE from dba_role_privs where grantee in (select username from dba_users where username not in ('SYS','SYSTEM') AND
ACCOUNT_STATUS='OPEN')) union SELECT GRANTEE,PRIVILEGE,ADMIN_OPTION FROM DBA_SYS_PRIVS WHERE GRANTEE in (select username from dba_users where username not in ('SYS','SYSTEM') AND ACCOUNT_STATUS='OPEN')) order by GRANTEE,PRIVILEGE;

Oracle用户及角色的权限管理[Oracle基础]的更多相关文章

  1. ORACLE - 用户和角色的权限管理

    在ORACLE中,创建用户后需要授权才能使用. 一.用户管理 1. 用户和角色信息查询 --查询所有用户 SQL> select * from dba_users; --经授予的用户或角色的系统 ...

  2. [转帖]PostgreSQL的用户、角色和权限管理

    PostgreSQL的用户.角色和权限管理 2018年05月18日 14:02:29 jerry-89 阅读数 6143 https://blog.csdn.net/eagle89/article/d ...

  3. Oracle 用户,角色,权限等

    权限管理是 Oracle 系统的精华,不同用户登录到同一数据库中,可能看到不同数量的表,拥有不同的权限.Oracle 的权限分为系统权限和数据对象权限,共一百多种,如果单独对用户授权,很囧,有一些用户 ...

  4. Oracle用户、角色、权限

    一.Oracle权限 系统权限:系统规定用户使用数据库的权限.(系统权限是对用户而言) 对象权限:某种权限用户对其它用户的表或视图的存取权限.(是针对表或视图而言的) 1.Oracle系统权限 ​ o ...

  5. Oracle 用户、角色、权限(系统权限、对象权限)的数据字典表

    1 三者的字典表 1.1 用户 select * from dba_users; select * from all_users; select * from user_users; 1.2 角色 s ...

  6. MONGODB用户、角色和权限管理

      最近遇到很多问MONGODB用户认证授权方面的问题,现在特记录下来,与大家共享. 一.概念理解 1.用户概念 Mongodb的用户是由 用户名+所属库名组成 例如: 登录mongo  testdb ...

  7. PostgreSQL学习笔记(九) 用户、角色、权限管理

    PostgreSQL是一个多用户数据库,可以为不同用户指定允许的权限. 角色PostgreSQL使用角色的概念管理数据库访问权限. 根据角色自身的设置不同,一个角色可以看做是一个数据库用户,或者一组数 ...

  8. PostgreSQL 用户、角色、权限管理

    PostgreSQL是一个多用户数据库,可以为不同用户指定允许的权限. 角色 PostgreSQL使用角色的概念管理数据库访问权限. 根据角色自身的设置不同,一个角色可以看做是一个数据库用户,或者一组 ...

  9. springBoot+springSecurity 数据库动态管理用户、角色、权限

    使用spring Security3的四种方法概述 那么在Spring Security3的使用中,有4种方法: 一种是全部利用配置文件,将用户.权限.资源(url)硬编码在xml文件中,已经实现过, ...

随机推荐

  1. 爬虫实现(hpricot)

    1.基本代码 在gemfile中加入gem "hpricot",bundler install之后,在application.rb中require "hpricot&qu ...

  2. Python爬虫和情感分析简介

    摘要 这篇短文的目的是分享我这几天里从头开始学习Python爬虫技术的经验,并展示对爬取的文本进行情感分析(文本分类)的一些挖掘结果. 不同于其他专注爬虫技术的介绍,这里首先阐述爬取网络数据动机,接着 ...

  3. java的Serialization 机制

    基本使用方法               Serialization是指把类或者基本的数据类型持久化(persistence)到数据流(Stream)中,包括文件.字节流.网络数据流.         ...

  4. Notepad++加上xml格式化的功能

    工作中需要用代码创建一个XML文件,创建完发现XML内容都处在同一行,导致非常不容易查看清楚XML代码.于是习惯性地用 Notepad++查看,想用它来对XML代码格式化一下. 于是找到了TextFX ...

  5. bzoj3572

    通过这题我知道了一个鬼故事,trunc(ln(128)/ln(2))=6……以后不敢轻易这么写了 好了言归正传,这题明显的构建虚树,但构建虚树后怎么树形dp呢? 由于虚树上的点不仅是议事会还有可能是议 ...

  6. bzoj2208:[Jsoi2010]连通数

    http://blog.csdn.net/u013598409/article/details/47037499 里面似乎有生成数据的... //我本来的想法是tarjan缩点之后然后将图遍历一遍就可 ...

  7. HNOI2008Cards

    看了一下polya和burnside定理,感觉还行(就是不会证……) 这题用的是burnside ans=在每个置换群下不动的方案数之和除以置换数 这题有个难点在取模 关于对p(p为素数)取模(涉及到 ...

  8. Android 自动换行流式布局的RadioGroup

    效果图 用法 使用FlowRadioGroup代替RadioGroup 代码 import android.content.Context; import android.util.Attribute ...

  9. 如何在asp.net mvc3中使用HttpStatusCode

    下载了asp.net mvc 4的源码看了看,没怎么看清楚.不过个人觉得MVC4 beta中Web API这个是比较不错的,虽然说它是往传统回归. web api最好的莫过于它更加适合使用jquery ...

  10. uboot环境变量与内核MTD分区关系

    uboot 与系统内核中MTD分区的关系: 分区只是内核的概念,就是说A-B地址放内核,C-D地址放文件系统,(也就是规定哪个地址区间放内核或者文件系统)等等. 1:在内核MTD中可以定义分区A~B, ...