Skip to content

Instantly share code, notes, and snippets.

@dotmaik1
Created October 6, 2016 16:48
Show Gist options
  • Select an option

  • Save dotmaik1/be6ec4b044b01effcae59add52759778 to your computer and use it in GitHub Desktop.

Select an option

Save dotmaik1/be6ec4b044b01effcae59add52759778 to your computer and use it in GitHub Desktop.
SQL Details Active Report
This report uses data from views that are licensed with the Diagnostics and Tuning Pack.
http://www.oracle.com/technetwork/database/manageability/sql-detail-099420.html
How do I generate a SQL Details Active Report?
From SQL*Plus, invoke the dbms_sqltune.report_sql_detail function and spool the output
set trimspool on trim on
set pages 0 linesize 1000
set long 1000000 longchunksize 1000000
spool sqlmon_details.html
select dbms_sqltune.report_sql_detail('&sql_id') from dual;
spool off
The resulting sql_details.html should be edited to remove the first line (call to dbms_sqltune.report_sql_detail) and the last line (the spool off), and then viewed in any browser, with connectivity to OTN.
What if I want to specify a time frame?
select dbms_sqltune.report_sql_detail('&sql_id',start_time=>to_date('&time','yyyy-mm-dd hh24:mi:ss'), duration=>&duration_in_seconds) from dual;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment