通过视图dba_tab_privs进行查询举个例子 查询SCOTT用户在对象上被赋予了哪些权限 SQL> select privilege,table_name from dba_tab_privs where grantee='SCOTT';PRIVILEGE TABLE_NAME ---------------------------------------- ------------------------------ SELECT DBA_SYS_PRIVS EXECUTE DBMS_FLASHBACKSQL>至于这个视图中的具体各个字段的含义如下 GRANTEE VARCHAR2(30) NOT NULL Name of the user to whom access was granted OWNER VARCHAR2(30) NOT NULL Owner of the object TABLE_NAME VARCHAR2(30) NOT NULL Name of the object. The object can be any object, including tables, packages, indexes, sequences, and so on. GRANTOR VARCHAR2(30) NOT NULL Name of the user who performed the grant PRIVILEGE VARCHAR2(40) NOT NULL Privilege on the object GRANTABLE VARCHAR2(3) Indicates whether the privilege was granted with the GRANT OPTION (YES) or not (NO) HIERARCHY VARCHAR2(3) Indicates whether the privilege was granted with the HIERARCHY OPTION (YES) or not (NO) 不过你注意一下我上面那个查询 并没有查出用户在其自己所属表(比如说SCOTT用户默认自带的DEPT,EMP表)上所拥有的权限
SQL> select privilege,table_name from dba_tab_privs where grantee='SCOTT';PRIVILEGE TABLE_NAME
---------------------------------------- ------------------------------
SELECT DBA_SYS_PRIVS
EXECUTE DBMS_FLASHBACKSQL>至于这个视图中的具体各个字段的含义如下
GRANTEE VARCHAR2(30) NOT NULL Name of the user to whom access was granted
OWNER VARCHAR2(30) NOT NULL Owner of the object
TABLE_NAME VARCHAR2(30) NOT NULL Name of the object. The object can be any object, including tables, packages, indexes, sequences, and so on.
GRANTOR VARCHAR2(30) NOT NULL Name of the user who performed the grant
PRIVILEGE VARCHAR2(40) NOT NULL Privilege on the object
GRANTABLE VARCHAR2(3) Indicates whether the privilege was granted with the GRANT OPTION (YES) or not (NO)
HIERARCHY VARCHAR2(3) Indicates whether the privilege was granted with the HIERARCHY OPTION (YES) or not (NO)
不过你注意一下我上面那个查询 并没有查出用户在其自己所属表(比如说SCOTT用户默认自带的DEPT,EMP表)上所拥有的权限