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

本站中文解释

Oracle V$CONTEXT 视图是展示当前数据库会话中使用到的上下文信息。上下文信息在 PL/SQL 中应用才有意义,例如:触发器、存储函数,触发器等调用之前,可以调用 “create_context()” 函数给上下文赋值,给查询做一个筛选条件,增加性能。

要使用 V$CONTEXT 视图,可以使用以下语句:

SELECT context_value FROM v$context WHERE context_name = ‘your_context’;

这条命令可以查询当前会话的上下文的值,以“your_context”为例,在查询“v$context”视图时输入当前会话的上下文信息就可以得到指定的信息。

官方英文解释

V$CONTEXT displays set attributes in the current session.

Column Datatype Description

NAMESPACE

VARCHAR2(31)

Namespace that the attribute is in

ATTRIBUTE

VARCHAR2(31)

Name of the attribute

VALUE

VARCHAR2(4000)

Value of the attribute

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$CONTEXT 官方解释,作用,如何使用详细说明