Oracle查出一个用户具有的所有系统权限和对象权限

1. 系统权限

SELECT *
  FROM dba_sys_privs
 WHERE grantee = 'SCOTT'
UNION ALL
SELECT *
  FROM dba_sys_privs
 WHERE grantee IN (SELECT granted_role
                     FROM dba_role_privs
                    WHERE grantee = 'SCOTT');

2. 对象权限

SELECT *
  FROM dba_tab_privs
 WHERE grantee = 'SCOTT'
UNION ALL
SELECT *
  FROM dba_tab_privs
 WHERE grantee IN (SELECT granted_role
                     FROM dba_role_privs
                    WHERE grantee = 'SCOTT');


你可能感兴趣的:(oracle)