Chinaunix首页 | 论坛 | 博客
  • 博客访问: 832183
  • 博文数量: 105
  • 博客积分: 636
  • 博客等级: 中士
  • 技术积分: 1704
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-11 10:57
文章分类

全部博文(105)

文章存档

2017年(4)

2016年(9)

2015年(18)

2014年(16)

2013年(34)

2012年(24)

分类: Oracle

2012-10-27 18:35:40

今天学习了一下v$session_longops这个动态性能视图和大家分享一下
v$session_longops 这是视图从字面意思上理解 操作时间比较长的会话(运行时间长的会话)
在联机文档中是这样描述的 v$session_longops display the status of various operations that run for longer than 6 seconds(in absolute time).
是说超过6秒的操作这个视图会显示出来
to monitor query execution progress,you must be using the cost-based optimizer and you must
*set the timed_statistics or sql_trace parameter true
* gather statistic for you object with the analyze statement or the dbms_stat package
上面说 如果想监控查询操作,首先要使用cbo模式,然后timed_statistics或sql_trace参数设置为true
还要使用统计工具 收集对象的信息
desc v$session_longops
sid ,serial 会话的id和串号
opname  操作的简短描述  (从这能分析出,执行的操作时做了什么)
target 操作对象
sofar 到目前为止 已经操作的数量(单位是后面的unit)
totalwork 总的操作量
unit (单位)
start_time last_update_time  开始时间和在持续的时间(结束时间)
elapsed_seconds 花费的时间
sql_address
sql_hash_value
sql_id
通过上面三个字段可以查询到执行的sql语句
select a.sid,a.serial#,a.opname,a.target,b.sql_text,sql_fulltext from
v$session_longops a,v$sqlarea b
where a.sql_id=b.sql_id and a.sql_hash_value=b.hash_value
 
 
 
 
 
 
 
 
 
 
 
阅读(5011) | 评论(0) | 转发(0) |
0

上一篇:一次事故

下一篇:oracle latch

给主人留下些什么吧!~~