日期:2014-05-16  浏览次数:20996 次

这个top sql的脚本是什么意思呐?
SQL code

--sid
select l.sid sid,
       substr(opname, 1, 15) opname,
       target,
       trunc((sofar / totalwork) * 100) pct,
       to_char(60 * sofar * 8192 /
               (24 * 60 * (last_update_time - start_time)) / 1024 / 1024 / 60,
               '9999.0') rate,
       elapsed_seconds / 60 es,
       time_remaining / 60 tr,
       program,
       machine
  from v$session_longops l, v$session s
 where time_remaining > 0
   and l.sid = s.sid
 order by start_time;

--sql
select l.sid sid,
       q.sql_text sql,
       substr(opname, 1, 15) opname,
       target,
       trunc((sofar / totalwork) * 100) pct,
       to_char(60 * sofar * 8192 /
               (24 * 60 * (last_update_time - start_time)) / 1024 / 1024 / 60,
               '9999.0') rate,
       elapsed_seconds / 60 es,
       time_remaining / 60 tr,
       program,
       machine
  from v$session_longops l, v$session s, v$sql q
 where time_remaining > 0
   and l.sid = s.sid
   and s.sql_id = q.sql_id
 order by start_time;


这个top sql的脚本是什么意思呐?在metalink上面找到的,但是我看不懂它的意图!!!求解!!!

------解决方案--------------------
这个链接上有每个字段的说明:
http://cc59.itpub.net/post/1845/286133