V$SESSION_LONGOPS
displays the status of various operations that run for longer than 6 seconds (in absolute time). These operations currently include many backup and recovery functions, statistics gathering, and query execution, and more operations are added for every Oracle release.
这个视图显示了运行时间超过6秒的一些操作的状态(绝对时间)。这些操作目前包括许多备份和恢复功能,统计信息收集,以及查询执行,以及更多的被加入到数据库版本中的操作。
To monitor query execution progress, you must be using the cost-based optimizer and you must:
为了监视查询执行的进度,你必须使用基于代价的优化器并且你必须:
-
Set the
TIMED_STATISTICS
orSQL_TRACE
parameters totrue
-
设置参数
TIMED_STATISTICS
或SQL_TRACE为TRUE
-
Gather statistics for your objects with the
DBMS_STATS
package -
用DBMS_STATS包为你的对象收集统计信息
You can add information to this view about application-specific long-running operations by using theDBMS_APPLICATION_INFO.SET_SESSION_LONGOPS
procedure.
你可以通过使用过程DBMS_APPLICATION_INFO.SET_SESSION_LONGOPS将一些应用指定的长时间运行操作信息添加到这个视图。
Column | Datatype | Description |
---|---|---|
SID | NUMBER | Identifier of the session processing the long-running operation. If multiple sessions are cooperating in the long-running operation, then SID corresponds to the main or master session.Session标识 |
SERIAL# | NUMBER | Serial number of the session processing the long-running operation. If multiple sessions are cooperating in the long-running operation, then SERIAL# corresponds to the main or master session. SERIAL# is used to uniquely identify a session's objects. Guarantees that session-level commands are applied to the correct session objects if the session ends and another session begins with the same session ID.Session串号 |
OPNAME | VARCHAR2(64) | Brief description of the operation 操作简要说明 |
TARGET | VARCHAR2(64) | Object on which the operation is carried out 操作运行所在的对象 |
TARGET_DESC | VARCHAR2(32) | Description of the target 目标对象说明 |
SOFAR | NUMBER | Units of work done so far for the operation specified in the OPNAME column在PNAME列指定的操作至今为止完成的工作量 |
TOTALWORK | NUMBER | Total units of work for the operation specified in the OPNAME column总工作量 |
UNITS | VARCHAR2(32) | Units of measurement 工作量单位 |
START_TIME | DATE | Starting time of the operation 操作开始时间 |
LAST_UPDATE_TIME | DATE | Time when statistics were last updated for the operation 统计项最后更新时间 |
TIMESTAMP | DATE | Timestamp specific to the operation |
TIME_REMAINING | NUMBER | Estimate (in seconds) of time remaining for the operation to complete 预计完成操作的剩余时间(秒) |
ELAPSED_SECONDS | NUMBER | Number of elapsed seconds from the start of the operations 从操作开始总花费时间(秒) |
CONTEXT | NUMBER | Context 前后关系 |
MESSAGE | VARCHAR2(512) | Statistics summary message 统计项的完整描述 |
USERNAME | VARCHAR2(30) | User ID of the user performing the operation 执行操作的用户ID |
SQL_ADDRESS | RAW(4 | 8) | Used with the value of the SQL_HASH_VALUE column to identify the SQL statement associated with the operation用于连接查询的列 |
SQL_HASH_VALUE | NUMBER | Used with the value of the SQL_ADDRESS column to identify the SQL statement associated with the operation |
SQL_ID | VARCHAR2(13) | SQL identifier of the SQL statement associated with the long operation, if any |
SQL_PLAN_HASH_VALUE | NUMBER | SQL plan hash value; NULL if SQL_ID is NULL |
SQL_EXEC_START | DATE | Time when the execution of the SQL started; NULL if SQL_ID is NULL |
SQL_EXEC_ID | NUMBER | SQL execution identifier (seeV$SQL_MONITOR ) |
SQL_PLAN_LINE_ID | NUMBER | SQL plan line ID corresponding to the long operation; NULL if the long operation is not associated with a line of the execution plan |
SQL_PLAN_OPERATION | VARCHAR2(30) | Plan operation name; NULL ifSQL_PLAN_LINE_ID is NULL |
SQL_PLAN_OPTIONS | VARCHAR2(30) | Plan operation options; NULL ifSQL_PLAN_LINE_ID is NULL |
QCSID | NUMBER | Session identifier of the parallel coordinator |