长sql与sql执行进度


--显示长sql
 SELECT sid,
         serial#,
         opname,
         target,
         start_time,
         (sofar / totalwork) * 100 progress,
         time_remaining,
         elapsed_seconds,
         sql_id,
         sql_address,
         sql_hash_value
    FROM v$session_longops
ORDER BY elapsed_seconds DESC;

------------------------------------------------------------

--获取sql的执行进度
SELECT sid,
       serial#,
       opname,
       target,
       start_time,
       (sofar / totalwork) * 100 progress,
       time_remaining,
       elapsed_seconds,
       a.sql_id,
       b.sql_text
  FROM v$session_longops a, v$sqlarea b
 WHERE a.sql_id = b.sql_id;

 

你可能感兴趣的:(sql,进度)