sql monitor

2023年 8月 23日 64.1k 0

--Text文本格式
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_text.txt
SELECT DBMS_SQLTUNE.REPORT_SQL_MONITOR(
SQL_ID => '0xnmwr1xn1rkv',
TYPE => 'TEXT',
REPORT_LEVEL => 'ALL') AS REPORT
FROM dual;
spool off

--Html格式
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_html.html
SELECT DBMS_SQLTUNE.REPORT_SQL_MONITOR(
SQL_ID => 'g9rtj389t0g66',
TYPE => 'HTML',
REPORT_LEVEL => 'ALL') AS REPORT
FROM dual;
spool off

--SQL Monitoring 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.html
SELECT dbms_sqltune.report_sql_monitor_list(
type => 'HTML',
report_level => 'ALL') AS report
FROM dual;
SPOOL OFF

select INST_ID,SQL_EXEC_ID ,SQL_EXEC_START,IS_ADAPTIVE_PLAN,SQL_PLAN_HASH_VALUE,ELAPSED_TIME/1000/1000,SID from gv$sql_monitor where sql_id='6f187xjmj4p0h' order by SQL_EXEC_START;

select dbms_sqltune.report_sql_monitor(sql_id=>'56awpm9qg6fu2',type=>'TEXT',report_level=>'ALL',SQL_EXEC_ID=>'16777386') from dual;

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论