Oracle 视图 V$DIAG_SESS_SQL_TRACE_RECORDS 官方解释,作用,如何使用详细说明
本站中文解释
Oracle视图V$DIAG_SESS_SQL_TRACE_RECORDS通常用来收集用户会话的SQL跟踪记录和性能调配的信息。它的最小记录开始时间决定当前会话结束时间,由v$diag_sess_trace.trace_cursor_end时间确定,最大记录完成时间由v$diag_sess_sql_trace_records.sql_finish_time确定。这个视图的主要用途是帮助管理员跟踪和记录他们的数据,即系统性能参数、实用SQL跟踪及自定义性能指标等。
使用V$DIAG_SESS_SQL_TRACE_RECORDS视图,可以收集多个会话对应的SQL话语跟踪信息,以及处理过程信息。通过查询这个视图,可以获得Oracle会话的SQL操作、解析和SGA登录状态的详细统计信息。
一般流程:
1、将v$diag_sess_sql_trace_records表中的curses_id、session_id、username这3个字段分别赋值给变量。
2、通过查询v$diag_sess_sql_trace_records表并将session_id字段与变量对比,获取符合条件的所有数据。
3、通过查询v$diag_sess_sql_trace_records表,并将username字段与变量对比,获取符合条件的所有数据。
4、检索候选结果,根据v$diag_sess_sql_trace_records表中的sql_finish_time字段,列出执行过的SQL语句。
5、关闭会话,然后查询V$diag_sess_sql_trace_records表,获取最新的跟踪记录和性能调整信息。
官方英文解释
V$DIAG_SESS_SQL_TRACE_RECORDS
contains all SQL_TRACE data that is present in the trace files for the current user session that is part of the current Automatic Diagnostic Repository (ADR).
Column | Datatype | Description |
---|---|---|
|
|
Path to current ADR home |
|
|
Displays the name of the process trace file |
|
|
Displays the level of the trace record |
|
|
Displays the top parent level of the trace record |
|
|
Displays the type of the trace record. Possible values include:
|
|
|
Displays the timestamp when the trace record was produced |
|
|
Displays the trace record payload (contents) |
|
|
Displays the section ID / dump ID of the trace record |
|
|
Displays the section name / dump name of the trace record |
|
|
Displays the component name which produced the trace record |
|
|
Displays the operation name which produced the trace record |
|
|
Displays the name of the code file where this trace record is produced |
|
|
Displays the function which produced this trace record |
|
|
Displays the line number in the code file which produced this trace record |
|
|
Displays the operating system thread ID of the process which produced the trace record |
|
|
Displays the user session ID which generated the trace record |
|
|
Displays the user session serial number which produced the trace record |
|
|
Displays the trace record security label classification. Possible values:
|
|
|
Displays the container unique ID where the trace record was produced |
|
|
Displays the container name where the trace record was produced |
|
|
The ID of the container to which the data pertains. Possible values include:
|