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

本站中文解释

Oracle视图V$SQL_CURSOR是用于监视系统内打开的SQL游标的一个可用的数据结构,其中可以查询或显示SQL游标的一般状态。

用法:

1、查看系统内打开的SQL游标状态。

例如,可以使用这个视图查询当前系统内打开的SQL游标:

SELECT * FROM V$SQL_CURSOR;

2、检查会话等执行SQL语句的状态。

例如,假定我们想查看执行sql查询的会话信息:

SELECT SID, SQL_CHILD_NUMBER, SQL_HASH_VALUE, SQL_TEXT
FROM V$SQL_CURSOR
WHERE SESSION_ID=;

可以使用上述语句检查执行查询的会话状态。

官方英文解释

V$SQL_CURSOR displays debugging information for each cursor associated with the session querying this view.

Column Datatype Description

CURNO

NUMBER

Cursor number

FLAG

NUMBER

Flags set in the cursor

STATUS

VARCHAR2(9)

Status of the cursor; that is, what state the cursor is in

PARENT_HANDLE

RAW(4 | 8)

Pointer to the parent cursor handle

PARENT_LOCK

RAW(4 | 8)

Pointer to the parent cursor lock

CHILD_LOCK

RAW(4 | 8)

Pointer to the child cursor lock

CHILD_PIN

RAW(4 | 8)

Pointer to the child cursor pin

PERS_HEAP_MEM

NUMBER

Total amount of memory allocated from persistent heap for this cursor

WORK_HEAP_MEM

NUMBER

Total amount of memory allocated from the work heap for this cursor

BIND_VARS

NUMBER

Total number of bind positions in the query currently parsed into this cursor

DEFINE_VARS

NUMBER

Total number of define variables in the query currently parsed into this cursor

BIND_MEM_LOC

VARCHAR2(64)

Which memory heap the bind variables are stored in: either the UGA or the CGA

INST_FLAG

VARCHAR2(64)

Instantiation object flags

INST_FLAG2

VARCHAR2(64)

Instantiation object flags (continued)

CHILD_HANDLE

RAW(4 | 8)

Pointer to the child cursor handle

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