Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

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

Select an option

Save dotmaik1/5f2e1868d63a498fdf99d8a48d4741d5 to your computer and use it in GitHub Desktop.
Real-Time SQL Monitoring using DBMS_SQLTUNE
--REPORT_SQL_MONITOR_LIST
SET LONG 1000000
SET LONGCHUNKSIZE 1000000
SET LINESIZE 1000
SET PAGESIZE 0
SET TRIM ON
SET TRIMSPOOL ON
SET ECHO OFF
SET FEEDBACK OFF
SPOOL report_sql_monitor_list.htm
SELECT DBMS_SQLTUNE.report_sql_monitor_list(
type => 'HTML',
report_level => 'ALL') AS report
FROM dual;
SPOOL OFF
--REPORT_SQL_DETAIL
SET LONG 1000000
SET LONGCHUNKSIZE 1000000
SET LINESIZE 1000
SET PAGESIZE 0
SET TRIM ON
SET TRIMSPOOL ON
SET ECHO OFF
SET FEEDBACK OFF
SPOOL report_sql_detail.htm
SELECT DBMS_SQLTUNE.report_sql_detail(
sql_id => 'c5q37wcf180n0',
type => 'ACTIVE',
report_level => 'ALL') AS report
FROM dual;
SPOOL OFF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment