The DBMS_AUTO_REPORT
package provides an interface to view SQL Monitoring and Real-time Automatic Database Diagnostic Monitor (ADDM) data that has been captured into Automatic Workload Repository (AWR). It also provides subprograms to control the behavior of how these data are captured to AWR.
See Also:
Oracle Database SQL Tuning Guide for more information about reporting database operationsThis chapter contains the following topics:
Overview
Security Model
This package provides an interface to view SQL Monitoring and Real-time ADDM data that has been captured into AWR. It also provides subprograms to control the behavior of how these data are captured to AWR.Captured data are stored in AWR and exposed via 2 views: DBA_HIST_REPORTS
and DBA_HIST_REPORTS_DETAILS
.
Table 31-1 DBMS_AUTO_REPORT Package Subprograms
Subprogram | Description |
---|---|
Ends the complete capture of SQL monitor data that was started with the START_REPORT_CAPTURE Procedure. |
|
Obtains the stored report for a given report ID |
|
Obtains the stored XML report for a given report ID |
|
Obtains an XML report of the list of SQL Monitor and Real-time ADDM data captured in AWR |
|
Captures SQL monitor data of any newly monitored SQLs every minute since the last run of the capture cycle, and stores it in AWR. |
This procedure ends the complete capture of SQL monitor data that was started with the START_REPORT_CAPTURE Procedure. This subprogram runs a last capture cycle immediately to capture any new data and then ends the per-minute complete capture.
After calling this subprogram, capture of data continues every minute except that it is not captured for all active SQLs but only for those deemed important, namely the top 5 SQLs (by elapsed time, or elapsed time*DOP in case of PQ) whose monitoring has completed.
This procedure obtains the stored report for a given report ID in the specified format such as XML or HTML.
DBMS_AUTO_REPORT.REPORT_REPOSITORY_DETAIL ( rid IN NUMBER DEFAULT NULL, type IN VARCHAR2 DEFAULT 'XML', base_path IN VARCHAR2 DEFAULT NULL) RETURNS CLOB
Table 31-2 REPORT_REPOSITORY_DETAIL Function Parameters
Parameter | Description |
---|---|
|
ID of the stored report which returned by the function |
|
Desired format of the report. Values can be |
|
Unused/Non-operative |
This procedure obtains the stored XML report for a given report ID.
DBMS_AUTO_REPORT.REPORT_REPOSITORY_DETAIL_XML ( rid IN NUMBER DEFAULT NULL, base_path IN VARCHAR2 DEFAULT NULL) RETURNS XMLTYPE
This procedure obtains an XML report of the list of SQL Monitor and Real-time ADDM data captured in AWR. The input parameters can be used to select and restrict which captured data will be included in the list report. All parameters are optional.
DBMS_AUTO_REPORT.REPORT_REPOSITORY_LIST_XML ( active_since IN DATE DEFAULT NULL, active_upto IN DATE DEFAULT NULL, snapshot_id IN NUMBER DEFAULT NULL, dbid IN NUMBER DEFAULT NULL, inst_id IN NUMBER DEFAULT NULL, con_dbid IN NUMBER DEFAULT NULL, session_id IN NUMBER DEFAULT NULL, session_serial IN NUMBER DEFAULT NULL, component_name IN VARCHAR2 DEFAULT NULL, key1 IN VARCHAR2 DEFAULT NULL, key2 IN VARCHAR2 DEFAULT NULL, key3 IN VARCHAR2 DEFAULT NULL, report_level IN VARCHAR2 DEFAULT 'TYPICAL', base_path IN VARCHAR2 DEFAULT NULL) RETURNS XMLTYPE
Table 31-4 REPORT_REPOSITORY_LIST_XML Function Parameters
Parameter | Description |
---|---|
|
Start of a time range used to select data. When a time range is specified, only those data are included in the list that were active during the time range. When no value is specified the time range is chosen as the last 24 hours ending at the current system time. |
|
Same as |
|
If a value is specified, only those data captured during the specified snapshot ID are included in the list report. If no value is specified, no filtering is performed on snapshot ID. |
|
If a value is specified, only those data captured for the specified database ID are included in the list report. If no value is specified, no filtering is performed on database ID |
|
If a value is specified, only those data captured on the specified instance number are included in the list report. If no value is specified, no filtering is performed on the instance ID. |
|
If a value is specified, only those data captured on the specified container DBID are included in the list report. If no value is specified, no filtering is performed on the container DBID. |
|
If a value is specified, only those data captured for the specified session ID are included in the list report. If no value is specified, no filtering is performed on session ID. |
|
If a value is specified, only those data captured for the specified session are included in the list report. If no value is specified, no filtering is performed on session serial number. This parameter should be used in conjunction with the |
|
Can be |
|
Key value relevant to a component. For SQL Monitor, |
|
Key value relevant to a component. For SQL Monitor, |
|
Key value relevant to a component. For SQL Monitor, |
|
Currently only |
|
Unused/Non-operative |
This procedure captures SQL monitor data of any newly monitored SQLs every minute since the last run of the capture cycle, and stores it in AWR. Every capture cycle attempts to capture data for SQLs that are not currently executing or queued. This is a complete capture since data of all newly monitored SQLs is captured. It continues to run every minute until it is explicitly ended with the FINISH_REPORT_CAPTURE Procedure. In the case of a RAC system, the capture will start on each node of the cluster.