脚本
select opname,
target,
to_char(start_time, 'yy-mm-dd:hh24:mi:ss') start_time,
elapsed_seconds elapsed,
executions execs,
buffer_gets / decode(executions, 0, 1, executions) bufgets,
module,
sql_text
from v$session_longops sl, v$sqlarea sa
where sl.sql_hash_value = sa.hash_value
and upper(substr(module, 1, 4)) <> 'RMAN'
and substr(opname, 1, 4) <> 'RMAN'
and module <> 'SQL*Plus'
and sl.start_time > trunc(sysdate)
order by start_time;
查询出的sql语句太长的话,可以通过下面文章的脚本查询得到。
http://blog.csdn.net/lijun_blue/article/details/7189851