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

本站中文解释

Oracle的ALL_SQL_TRANSLATIONS视图保存系统中所有已编译的 SQL 文本的格式。可以查询此视图以获取 SQL 如何被编译及查询是否存在更有效的优化。

要使用ALL_SQL_TRANSLATIONS视图,首先需要创建一个表。创建一个表时,需要在sql语句中指定要创建的表的字段,大小类型等。例如:

CREATE TABLE TEST_TABLE
(
id INTEGER,
name VARCHAR2(50)
);

接下来,请查看ALL_SQL_TRANSLATIONS视图,以获取表的格式,包括每个字段的大小和类型,以及如何处理它们:

SELECT *
FROM ALL_SQL_TRANSLATIONS
WHERE OBJECT_NAME = ‘TEST_TABLE’
AND OBJECT_TYPE = ‘TABLE’;

查询结果会列出字段的格式,以及 SQL 是否可以更有效地处理该表。你可以使用此结果来定位问题并做出改进。

官方英文解释

ALL_SQL_TRANSLATIONS describes all SQL translations accessible to the user.

Related Views

  • DBA_SQL_TRANSLATIONS describes all SQL translations in the database.

  • USER_SQL_TRANSLATIONS describes all SQL translations owned by the user. This view does not display the OWNER column.

Column Datatype NULL Description

OWNER

VARCHAR2(128)

NOT NULL

Owner of the SQL translation profile

PROFILE_NAME

VARCHAR2(128)

NOT NULL

Name of the SQL translation profile

SQL_TEXT

CLOB

NOT NULL

The SQL statement

TRANSLATED_TEXT

CLOB

The translated SQL statement

SQL_ID

VARCHAR2(13)

NOT NULL

SQL identifier of the SQL statement

HASH_VALUE

NUMBER

NOT NULL

Hash value of the SQL statement

ENABLED

VARCHAR2(5)

Displays whether the translation is enabled. Possible values:

  • TRUE

  • FALSE

REGISTRATION_TIME

TIMESTAMP(6)

Time the translation was registered

CLIENT_INFO

VARCHAR2(64)

Client information when the SQL was parsed and the translation was registered

MODULE

VARCHAR2(64)

Module when the SQL was parsed and the translation was registered

ACTION

VARCHAR2(64)

Action when the SQL was parsed and the translation was registered

PARSING_USER_ID

NUMBER

Current user ID when the SQL was parsed and the translation was registered

PARSING_SCHEMA_ID

NUMBER

Current schema ID when the SQL was parsed and the translation was registered

COMMENTS

VARCHAR2(4000)

Comment on the translation

ERROR_CODE

NUMBER

Last error code when the SQL was run

ERROR_SOURCE

VARCHAR2(9)

Source of the last error

TRANSLATION_METHOD

VARCHAR2(10)

Method used to translate the SQL during the last error

DICTIONARY_SQL_ID

VARCHAR2(13)

SQL identifier of the SQL text in the translation dictionary used to translate the SQL during the last error

See Also:

  • “DBA_SQL_TRANSLATIONS”

  • “USER_SQL_TRANSLATIONS”


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