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

本站中文解释

Oracle视图V$SQLTEXT_WITH_NEWLINES是一个动态数据库视图,它可以用来查看应用程序中当前对数据库的SQL语句,比如select语句,update语句, insert语句等。查看此视图时,SQL句子中的每个组件都可以分离出来,因此可以轻松拆解复杂的SQL语句,查看SQL语句的内容和结构,以及句子的执行时间。

使用这个视图的方法非常简单,可以直接使用SELECT语句来从其中查询信息,也可以参考V$SQLTEXT_WITH_NEWLINES视图中提供的说明,根据指定条件来查询所需要的信息:

SELECT SQL_TEXT, SQL_FULLTEXT, EXECUTION_START, EXECUTION_END
FROM V$SQLTEXT_WITH_NEWLINES
WHERE EXECUTION_START BETWEEN ‘2018-2-2 00:00:00’ AND ‘2018-2-2 23:59:59’
AND SQL_FULLTEXT LIKE ‘SELECT%’;

官方英文解释

V$SQLTEXT_WITH_NEWLINES is identical to the V$SQLTEXT view except that, to improve legibility, V$SQLTEXT_WITH_NEWLINES does not replace newlines and tabs in the SQL statement with spaces.

Column Datatype Description

ADDRESS

RAW(4 | 8)

Used with HASH_VALUE to uniquely identify a cached cursor

HASH_VALUE

NUMBER

Used with ADDRESS to uniquely identify a cached cursor

SQL_ID

VARCHAR2(13)

SQL identifier of a cached cursor

COMMAND_TYPE

NUMBER

Code for the type of SQL statement (SELECT, INSERT, and so on)

PIECE

NUMBER

Number used to order the pieces of SQL text

SQL_TEXT

VARCHAR2(64)

A column containing one piece of the SQL text

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

See Also:

“V$SQLTEXT”


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