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

本站中文解释

Oracle视图V$OBJECT_PRIVILEGE是动态性的系统视图,展示对对象的存取权限的详细信息,它显示给定用户拥有的访问某个对象的权限。这些对象可以是表、视图、序列、过程、函数等。其中的字段GRANTEE指定接到许可的用户,PRIVILEGE指定授于这个用户的许可,GRANTABLE标识GRANTEE是否可以从其它用户得到权限后再授予其它用户。

使用方法:

1. 查询用户对对象的权限列表

以查询数据库中表 emp 的权限为例,语句如下:

SELECT GRANTEE, PRIVILEGE, GRANTABLE
FROM V$OBJECT_PRIVILEGE
WHERE OBJECT_NAME = ‘EMP’;

2.查询指定用户拥有的对象权限

以查询用户SCOTT拥有的对象权限为例,语句如下:

SELECT OBJECT_NAME, GRANTEE, PRIVILEGE, GRANTABLE
FROM V$OBJECT_PRIVILEGE
WHERE GRANTEE = ‘SCOTT’
ORDER BY OBJECT_NAME;

官方英文解释

V$OBJECT_PRIVILEGE displays information about privileges associated with an object.

Column Datatype Description

OBJECT_TYPE_NAME

VARCHAR2(64)

Name of the object type

OBJECT_TYPE_ID

NUMBER

ID of the object type

PRIVILEGE_ID

NUMBER

ID of the privilege

PRIVILEGE_NAME

VARCHAR2(64)

Name of the privilege

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data


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