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

本站中文解释

ALL_COL_PRIVS视图用于显示当前用户或其它用户拥有的表或视图的列权限,其主要由如下6个字段组成:

GRANTEE: 拥有权限的用户或程序
TABLE_SCHEMA: 表或视图所属的Schema
TABLE_NAME: 表或视图名
COLUMN_NAME: 列名
PRIVILEGE: 权限类型
IS_GRANTABLE: 用户是否可将权限授予其它用户

使用ALL_COL_PRIVS视图可以很容易查询指定用户(GRANTEE)拥有某张表(TABLE_NAME)中列(COLUMN_NAME)的权限(PRIVILEGE),以及是否可将权限授予其他用户(IS_GRANTABLE)。例如:

查询当前登录用户拥有表 USERS 中所有列的权限
SELECT GRANTEE, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, PRIVILEGE, IS_GRANTABLE
FROM ALL_COL_PRIVS
WHERE GRANTEE = USER AND TABLE_NAME = ‘USERS’;

官方英文解释

ALL_COL_PRIVS describes the following types of grants:
  • Column object grants for which the current user is the object owner, grantor, or grantee

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

Related Views

  • DBA_COL_PRIVS describes all column object grants in the database.

  • USER_COL_PRIVS describes the column 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

COLUMN_NAME

VARCHAR2(128)

Name of the column

PRIVILEGE

VARCHAR2(40)

Privilege on the column

GRANTABLE

VARCHAR2(3)

Indicates whether the privilege was granted with the GRANT 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)

INHERITED

VARCHAR2(3)

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

See Also:

  • “DBA_COL_PRIVS”

  • “USER_COL_PRIVS”


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