加入收藏 | 设为首页 | 会员中心 | 我要投稿 核心网 (https://www.hxwgxz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长百科 > 正文

oracle – 列出具有root(管理)权限的用户

发布时间:2021-03-15 11:14:04 所属栏目:站长百科 来源:网络整理
导读:我想知道在Oracle中具有root(管理)权限的所有用户的列表. 我想在脚本或C应用程序中.脚本是首选. 解决方法 以下是您查找用户权限的方法: select lpad(' ',2*level) || granted_role "User,his roles and privileges"from ( /* THE USERS */ select null gran

我想知道在Oracle中具有root(管理)权限的所有用户的列表.
我想在脚本或C应用程序中.脚本是首选.

解决方法

以下是您查找用户权限的方法:

select
  lpad(' ',2*level) || granted_role "User,his roles and privileges"
from
  (
  /* THE USERS */
    select 
      null     grantee,username granted_role
    from 
      dba_users
  /* THE ROLES TO ROLES RELATIONS */ 
  union
    select 
      grantee,granted_role
    from
      dba_role_privs
  /* THE ROLES TO PRIVILEGE RELATIONS */ 
  union
    select
      grantee,privilege
    from
      dba_sys_privs
  )
start with grantee is null
connect by grantee = prior granted_role;

这将显示哪些用户具有虚增的权限.您可以通过键入在shell脚本中执行此操作

sqlplus / as sysdba --(if you are root on the box)
spool user_privileges.txt
@whos_a_root.sql --(if that's what you call your script)
spool off
exit;

(编辑:核心网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读