Oracle 视图 DBA_TAB_PRIVS 官方解释,作用,如何使用详细说明

本站中文解释

Oracle数据库的DBA_TAB_PRIVS视图是一种系统数据库视图,它报告给定用户的表列或者视图的特定权限。比如,查看表的创建权限;查看表行的权限,例如更新、插入和删除;或查看对象的引用权限,例如将表作为外键的列的引用权限。

使用DBA_TAB_PRIVS视图时,可以通过几种方法来执行查询。首先,可以查看特定用户的特定行或视图的特定权限:

SELECT GRANTEE, TABLE_NAME, PRIVILEGE FROM DBA_TAB_PRIVS WHERE GRANTEE=’username’AND TABLE_NAME=’tablename’;

此外,还可以查看特定用户拥有特定表或视图特定权限的所有对象:

SELECT GRANTEE, TABLE_NAME, PRIVILEGE FROM DBA_TAB_PRIVS WHERE GRANTEE=’username’AND PRIVILEGE=’privilege’;

最后,还可以查看拥有特定表或视图权限的所有用户:

SELECT GRANTEE, TABLE_NAME, PRIVILEGE FROM DBA_TAB_PRIVS WHERE TABLE_NAME=’tablename’AND PRIVILEGE=’privilege’;

官方英文解释

DBA_TAB_PRIVS describes all object grants in the database.

Related View

USER_TAB_PRIVS describes the object grants for which the current user is the object owner, grantor, or grantee.

Column Datatype NULL Description

GRANTEE

VARCHAR2(128)

Name of the user or role to whom access was granted

OWNER

VARCHAR2(128)

Owner of the object

TABLE_NAME

VARCHAR2(128)

Name of the object. The object can be any object, including tables, packages, indexes, sequences, and so on.

GRANTOR

VARCHAR2(128)

Name of the user who performed the grant

PRIVILEGE

VARCHAR2(40)

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)

COMMON

VARCHAR2(3)

Indicates how the grant was made. Possible values:

  • YES if the privilege was granted commonly (CONTAINER=ALL was used)

  • NO if the privilege was granted locally (CONTAINER=ALL was not used)

TYPE

VARCHAR2(24)

Type of the object

INHERITED

VARCHAR2(3)

Indicates whether the grant was inherited from another container (YES) or not (NO)

See Also:

“USER_TAB_PRIVS”


数据运维技术 » Oracle 视图 DBA_TAB_PRIVS 官方解释,作用,如何使用详细说明