监控sql执行时剩余时间
来源:互联网 发布:javamail smtp 端口 编辑:程序博客网 时间:2024/04/28 08:50
--监控sql执行时剩余时间你知道正在运行的sql大概需要多长时间么?你知道正在运行的sql大概完成了百分之几么?你知道正在运行的sql大概还要多长时间完成么?V$SESSION_LONGOPS帮你忙。V$SESSION_LONGOPS在<span style="font-family: Arial, Helvetica, sans-serif;">官方文档中的描述:</span>V$SESSION_LONGOPS displays the status of various operations that run for longer than 6 seconds (in absolute time). These operations currently include many backup and recovery functions, statistics gathering, and query execution, and more operations are added for every Oracle release.To monitor query execution progress, you must be using the cost-based optimizer and you must:Set the TIMED_STATISTICS or SQL_TRACE parameters to trueGather statistics for your objects with the DBMS_STATS package--意义:统计各个操作时间大于6s的语句--前提条件:基于成本的优化器cboTIMED_STATISTICS或SQL_TRACE为true对象有统计信息测试:select * from v$version;--Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64biselect * from v$parameter where name like '%timed_statistics%'VALUETRUEselect last_analyzed from user_tables where table_name='LHJ_1G'LAST_ANALYZED2013-12-10 PM 01:19:36--session1:drop table t;create table t as select * from lhj_1g;--session2:select a.username, a.target, a.sid, a.SERIAL#, a.opname, round(a.sofar * 100 / a.totalwork, 0) || '%' as progress, --进度条 time_remaining second, --剩余时间:秒 trunc(a.time_remaining / 60, 2) minute,--剩余时间:分钟 b.sql_text, b.LAST_ACTIVE_TIME from v$session_longops a, v$sqlarea b where a.time_remaining <> 0 and a.sql_address = b.address and a.sql_hash_value = b.hash_value and a.username = 'GGS'
过一会再重复执行上面语句:
sql语句执行完成或者取消后,以上查询为空
0 0
- 监控sql执行时剩余时间
- 监控Hibernate执行SQL
- sqlserver监控sql执行
- MySql 监控sql执行
- 剩余时间
- Spring AOP监控SQL执行
- mysql 监控 sql执行语句
- java 监控mysql执行sql
- Spring AOP监控SQL执行
- oracle 配置autotrace监控sql执行计划
- 跟踪监控MYSQL执行的sql语句
- J2EE应用监控后台执行SQL
- sybase监控执行sql(转自新浪)
- 跟踪监控MYSQL执行的sql语句
- 跟踪监控MYSQL执行的sql语句
- 使用Druid监控SQL执行状态
- 没有SQL Profiler,如何监控sql的执行
- 在性能测试时,如何观察服务器端Oracle在执行的Sql语句【监控】
- win7下播放组播
- WUA API学习笔记
- socket: 揭开Socket编程的面纱
- Java通过浏览器请求头(User-Agent)获取 浏览器类型,操作系统类型,手机机型
- 第十周项目一 (程序填充与阅读) 1:
- 监控sql执行时剩余时间
- 第九周项目三之输出星号图c
- C#-—烟台大学的网址的访问
- SecureCRT的使用方法和技巧(详细使用教程)
- 第十周项目一 程序填充与阅读
- 循环冗余校验(CRC)算法入门引导 读后总结
- cocos2dx 3.2下利用ui::scrollView实现跑马灯滚动效果
- 程序填充与阅读(1)
- Protocol Buffers安装与简单使用