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

本站中文解释

这个视图

ALL_TAB_PRIVS视图用于查询当前用户的对对象的访问权限,包括表和视图。它包含以下列:
TABLE_SCHEMA:表空间
TABLE_NAME:表名
GRANTOR:授权者
GRANTEE:被授权用户
PRIVILEGE:被授予的权限
GRANTABLE:是否可被授予

使用说明:
1、查询当前下特定表的用户拥有的访问权限:
SELECT TABLE_NAME, GRANTEE, PRIVILEGE
FROM ALL_TAB_PRIVS
WHERE TABLE_NAME = ‘表名’;

2、查询当前用户对特定表拥有的访问权限:
SELECT GRANTEE, PRIVILEGE
FROM ALL_TAB_PRIVS
WHERE GRANTEE = ‘当前用户名’ AND TABLE_NAME = ‘表名’;

3、查询特定用户的表的拥有的访问权限:
SELECT GRANTEE, TABLE_NAME, PRIVILEGE
FROM ALL_TAB_PRIVS
WHERE GRANTEE = ‘特定用户名’;

官方英文解释

ALL_TAB_PRIVS describes grants.

ALL_TAB_PRIVS describes the following types of grants:

  • Object grants for which the current user is the object owner, grantor, or grantee

  • Object grants for which an enabled role or PUBLIC is the grantee

Related Views

  • DBA_TAB_PRIVS describes all object grants in the database.

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

Column Datatype NULL Description

GRANTOR

VARCHAR2(128)

Name of the user who performed the grant

GRANTEE

VARCHAR2(128)

Name of the user or role to whom access was granted

TABLE_SCHEMA

VARCHAR2(128)

Schema of the object

TABLE_NAME

VARCHAR2(128)

Name of the object

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 privilege grant was inherited from another container (YES) or not (NO)

See Also:

  • “DBA_TAB_PRIVS”

  • “USER_TAB_PRIVS”


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