Chapter 37. DBMS_SQLTUNE

Table of Contents

37.1. Overview
37.2. Function
37.2.1. REPORT_SQL_MONITOR

This chapter briefly introduces the DBMS_SQLTUNE package, and describes how to use the procedures of the package.

37.1. Overview

Currently DBMS_SQLTUNE only provides the function that creates real-time SQL monitoring reports.

37.2. Function

This section describes the function provided by the DBMS_SQLTUNE package.

37.2.1. REPORT_SQL_MONITOR

Creates a report with performance data about specific SQL executions collected using real-time SQL monitoring function. The report is in text format.

Details about the REPORT_SQL_MONITOR function are as follows:

  • Prototype

    DBMS_SQLTUNE.REPORT_SQL_MONITOR
    (
        sql_id         IN VARCHAR DEFAULT NULL,
        session_id     IN NUMBER  DEFAULT NULL,
        session_serial IN NUMBER  DEFAULT NULL,
        sql_exec_start IN DATE    DEFAULT NULL,
        sql_exec_id    IN NUMBER  DEFAULT NULL
    ) 
    RETURN CLOB;
  • Parameter

    ParameterDescription
    sql_id

    SQL identifier of SQL execution for which the report is to be created.

    If set to NULL, a report is created for the most recent SQL execution monitored in the current system.

    session_id

    If set to a non-NULL value, the report is created for SQL executions for the specified session.

    If the value is non-NULL but sql_id is NULL, the report is created for the most recent SQL execution monitored in the specified session.

    session_serial

    Used to additionally specify the desired session.

    If the session_id parameter is set to NULL, this parameter is ignored.

    sql_exec_start

    Valid only when the sql_id parameter is specified.

    The report is created with monitoring data about SQL executions with the specified sql_id and sql_exec_start values.

    sql_exec_id

    Valid only when the sql_id parameter is specified.

    The report is created with monitoring data about SQL executions with the specified sql_id and sql_exec_id values.

  • Return Value

    ValueDescription
    CLOB dataStrings created into a report format are returned as CLOB data.
  • Example

    set long 1000000;
    select dbms_sqltune.report_sql_monitor from dual;