微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Oracle 11g 比10046更直观的工具DBMS_SQLTUNE

比起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 注意:要想分析生成文件必须得连上网络。

原文地址:https://www.jb51.cc/oracle/207371.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐