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

本站中文解释

Oracle视图V$SQL_TESTCASES用于查看Oracle数据库中运行的SQL测试用例的信息。它的主要包括SQL测试用例的ID,实例,模块,结果等信息,可以帮助用户对正在运行的每个语句的性能进行监控和分析,从而做出相应的调整改进。

使用方法:用户可以使用如下语句查看V$SQL_TESTASES:SELECT * FROM V$SQL_TESTCASES;

这条语句将会返回一张以SQL测试案例为ID数字分组的表,每个分组包含执行SQL测试案例的SQL语句,其中所有字段的含义分别为:

SQL_TESTCASE:测试案例ID
INST_ID:执行实例ID
MODULE:SQL模块
PROCESS_ID:执行进程ID
USERS_ID:用户ID
RESULT:执行结果
START_TIME:开始时间
END_TIME:结束时间

官方英文解释

V$SQL_TESTCASES displays information about test cases exported by SQL Test Case Builder.

You can use this view in conjunction with the V$DIAG_INCIDENT view. Join the INCIDENT_ID column in this view with the INCIDENT_ID column in V$DIAG_INCIDENT to view information about the test case associated with a particular incident.

The V$SQL_TESTCASES view requires the existence of a TCB root directory named SQL_TCB_DIR. This view will not contain any rows if a TCB root directory does not exist, or if the TCB root directory exists with a name other than SQL_TCB_DIR. The operating system directory to which the TCB root directory refers must be writable by the owner of the Oracle Database binaries.

  • In Oracle Autonomous Database environments, the TCB root directory is created automatically on each POD during provisioning.
  • For on-premises databases, a user who has been granted the DBA role must explicitly create the TCB root directory. See Oracle Database
    Administrator’s Guide
    for more information.

Column Datatype Description

TESTCASE_NAME

VARCHAR2(512)

Test case name

SQL_ID

VARCHAR2(13)

SQL identifier of the SQL statement in the test case

SQL_TEXT

VARCHAR2(1000)

First 1000 characters of text for the SQL statement in the test case

SQL_TEXT_FULL

CLOB

Full text for the SQL statement in the test case, exposed as a CLOB column

INCIDENT_ID

NUMBER

ID for the incident associated with the test case

PROBLEM_TYPE

NUMBER

Type of problem for the incident associated with the test case. Possible values:

  • 1: Performance problem (PROBLEM_TYPE_PERFORMANCE)
  • 2: Inconsistent results (PROBLEM_TYPE_WRONG_RESULTS)
  • 3: Crash in compilation (PROBLEM_TYPE_COMPILATION_ERROR)
  • 4: Crash in execution (PROBLEM_TYPE_EXECUTION_ERROR)

These numeric values, and their associated constant values shown in parentheses, correspond to the numeric and constant values for problem type constants in the DBMS_SQLDIAG package. See Oracle Database PL/SQL
Packages and Types Reference
for more information.

CREATION_DATE

TIMESTAMP(6)

Creation time for the incident associated with the test case

STATUS

VARCHAR2(10)

Current status for the incident associated with the test case. Possible values:

  • COMPLETE: The test case export completed successfully
  • INCOMPLETE: The test case export failed due to an error

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$DIAG_INCIDENT”


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