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

本站中文解释

V$MAPPED_SQL视图是一个只读的数据视图,其中包含数据库中已经映射的SQL语句。该视图是以系统全局区(SGA)中的“缓存映射SQL”表为基础而建立的,包含有关所有加载到Oracle数据库的SQL语句的信息。

Oracle使用V$MAPPED_SQL视图可以查询和监测那些已缓存,正在被执行或具有最高可用性的SQL语句,而这些语句可能用于检索,更新和插入数据。特别的,可以检查在任何指定时间,任何SQL语句是否被加载到SGA中,并且确定是否可以根据语句内容完成缓冲等待时间。

要使用该视图,可用于查询V$MAPPED_SQL视图,并列出所有已缓存的SQL语句信息。例如:

SELECT * FROM V$MAPPED_SQL;

这将列出所有已缓存的SQL语句,包括SQL标识符,它们映射到的引用地址,SQL语句,SQL文本和其他信息,例如执行次数、平均执行时间等。

官方英文解释

V$MAPPED_SQL lists the SQL statements that are translated and mapped in memory to a different SQL statement for execution.

Column Datatype Description

SQL_TEXT

VARCHAR2(1000)

First 1000 characters of the original SQL text

SQL_FULLTEXT

CLOB

Full text for the original SQL statement

SQL_ID

VARCHAR2(13)

SQL identifier of the original SQL statement

HASH_VALUE

NUMBER

Hash value of the original SQL statement

MAPPED_SQL_TEXT

VARCHAR2(1000)

First 1000 characters of the mapped SQL text

MAPPED_SQL_FULLTEXT

CLOB

Full text for the mapped SQL statement

MAPPED_SQL_ID

VARCHAR2(13)

SQL identifier of the mapped SQL statement

MAPPED_HASH_VALUE

NUMBER

Hash value of the mapped SQL statement

SQL_TRANSLATION_PROFILE_ID

NUMBER

A non-NULL value specifies the object ID of the SQL translation profile used to translate the SQL statement into the mapped SQL statement

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

TRANSLATION_TIMESTAMP

DATE

Time this SQL statement was translated

TRANSLATION_CPU_TIME

NUMBER

CPU time used to translate this SQL statement

TRANSLATION_ELAPSED_TIME

NUMBER

Elapsed time used to translate this SQL statement

TRANSLATION_METHOD

VARCHAR2(10)

Method used to translate this SQL statement

DICTIONARY_SQL_ID

VARCHAR2(13)

SQL ID of SQL text in custom translation dictionary used to translate this SQL statement

USE_COUNT

NUMBER

Number of times this translation has been used


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