比起10046,它的优势是图像化界面更加友好,可以看到每一步占用的cpu,IO的等待时间及大小,特别是并行的执行计划10046会生成太多的文件,不好分析,它只生成一个。
The real-time sql monitoring feature of Oracle Database enables you to monitor the performance of sql statements while they are executing. By default,sql monitoring automatically starts when a sql statement runs parallel,or when it has consumed at least 5 seconds of cpu or I/O time in a single execution.
sql以并行方式或者单独运行占用cpu或IO的时间超过5秒钟就会自动被ORACLE启用监视。
如果没有权限执行DBMS_sqlTUNE,则需要赋予用户ADVISOR权限
grant ADVISOR to test;
要想看report,需要查询是否在gv$sql_monitor中是否存在。
select * from gv$sql_monitor s where s.sql_ID='3m43vtkhgh83u';
set pages 0 echo off timing off linesize 1000 trimspool on trim on long 2000000 Feedback off spool d:/453hh5f98kzqw.html SELECT DBMS_sqlTUNE.report_sql_monitor( type=> 'active',sql_id=> '453hh5f98kzqw',sql_exec_id=>null,report_level=> 'ALL' ) monitor_report FROM dual; SPOOL OFF 注意:要想分析生成的文件必须得连上网络。
The real-time sql monitoring feature of Oracle Database enables you to monitor the performance of sql statements while they are executing. By default,sql monitoring automatically starts when a sql statement runs parallel,or when it has consumed at least 5 seconds of cpu or I/O time in a single execution.
sql以并行方式或者单独运行占用cpu或IO的时间超过5秒钟就会自动被ORACLE启用监视。
如果没有权限执行DBMS_sqlTUNE,则需要赋予用户ADVISOR权限
grant ADVISOR to test;
要想看report,需要查询是否在gv$sql_monitor中是否存在。
select * from gv$sql_monitor s where s.sql_ID='3m43vtkhgh83u';
set pages 0 echo off timing off linesize 1000 trimspool on trim on long 2000000 Feedback off spool d:/453hh5f98kzqw.html SELECT DBMS_sqlTUNE.report_sql_monitor( type=> 'active',sql_id=> '453hh5f98kzqw',sql_exec_id=>null,report_level=> 'ALL' ) monitor_report FROM dual; SPOOL OFF 注意:要想分析生成的文件必须得连上网络。