简体   繁体   English

如何在Oracle数据库的DBA_SYS_PRIVS表中标识用户帐户

[英]How to identify user account in DBA_SYS_PRIVS table in Oracle Database

I'm trying to look for all the users with certain privileges in the DBA_SYS_PRIVS table. 我正在尝试在DBA_SYS_PRIVS表中查找具有某些特权的所有用户。 The table has a GRANTEE column and according to Oracle Official website, the GRANTEE column shows "Grantee name, user, or role receiving the grant". 该表具有GRANTEE列,并且根据Oracle官方网站,GRANTEE列显示“接受授予的被授予者姓名,用户或角色”。 So how could I know if the GRANTEE is an account or a role? 那么我怎么知道GRANTEE是帐户还是角色? For example, there is role called SYS and also an account called SYS in the Oracle DB. 例如,在Oracle DB中有一个名为SYS的角色,还有一个名为SYS的帐户。 So how do I know if this is an account or role???? 那么我怎么知道这是一个帐户还是角色????

Also in table DBA_TAB_PRIVS, there is a column called GRANTEE. 同样在表DBA_TAB_PRIVS中,有一列称为GRANTEE。 And in this table, the column GRANTEE is "Name of the user to whom access was granted". 在此表中,GRANTEE列是“授予访问权限的用户名”。 So I am really confused because the "GRANTEE" column means different things in two different tables 所以我很困惑,因为“ GRANTEE”列在两个不同的表中表示不同的东西

Please help, thanksssssssssssssss 请帮忙,谢谢ssssssssssss

No there is no SYS role in Oracle. 在Oracle中没有SYS角色。

 SQL> select * from dba_roles where role='SYS';

 no rows selected

Actually you cant create roles same name as usernames. 实际上,您无法创建与用户名相同名称的角色。

 SQL> create role sys;
 create role sys
        *
 ERROR at line 1:
ORA-01921: role name 'SYS' conflicts with another user or role name

To get only the roles without usernames. 仅获取不带用户名的角色。

SQL>select grantee from dba_sys_privs where grantee not in(select username from all_users);

To get only users without roles. 仅获取没有角色的用户。

 SQL>select grantee from dba_sys_privs where grantee in(select username from all_users)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当用户名不存在于DBA_TAB_PRIVS表中时,如何确定用户具有哪些特权? - How to determine what privileges a user has when the username is not present in the DBA_TAB_PRIVS table? 以用户身份连接时,在Oracle数据库中收集dba_users信息 - gather dba_users information in Oracle database when connected as a user 以普通用户身份连接时在不授予特权的情况下在Oracle数据库中收集dba_users信息 - gather dba_users information in Oracle database when connected as normal user without granting privileges 尝试在Oracle DB中标识架构列表时dba_segments和dba_users之间的区别 - Difference between dba_segments and dba_users when trying to identify list of schema in Oracle DB 如何将 DBA_HIST_* 表与 V$LOGMNR_CONTENTS 表连接 - Oracle DB - How to join DBA_HIST_* tables with V$LOGMNR_CONTENTS table - Oracle DB 如何在 Amazon ORACLE AWS RDS 的 TEMP TABLESPACE 表 DBA_TEMP_FILES 中将 AUTOEXTENSIBLE 列更改为 YES? - How to change the AUTOEXTENSIBLE column to YES in table DBA_TEMP_FILES for TEMP TABLESPACE in Amazon ORACLE AWS RDS? Oracle公共共享数据库链接不适用于非DBA用户 - Oracle public shared database link not working for non-DBA users Oracle DBA Privilege是否包含“创建任何表”角色? - Is Oracle DBA Privilege include “CREATE ANY TABLE” role? 如何将 java 作为 SYS 连接到 Oracle? - How to connect in java as SYS to Oracle? 适用于Oracle Developer / DBA的SQL Server - SQL server for an oracle developer/dba
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM