select distinct( sl.serial#),
'EXECUTE' AS STATUS,
SL.TIME_REMAINING||' c.' AS REMAIN,
SL.ELAPSED_SECONDS||' c.' AS ELAPSED,
SL.START_TIME "TIME",
SL.SQL_ID,
S.SQL_TEXT,
se.sid,
sl.opname,
sl.SOFAR,
sl.TOTALWORK,
round((sl.SOFAR/sl.TOTALWORK)*100,2) as "%",
sl.MESSAGE,
se.USERNAME,
se.OSUSER,
se.MACHINE,
se.PROGRAM
  from V$SESSION SE, V$SESSION_LONGOPS SL, V$SQL S
 where SE.SID=SL.SID
   AND SE.SERIAL#=SL.SERIAL#
   AND SE.SQL_ID=S.SQL_ID
   AND SE.USERNAME IS NOT NULL
   AND SL.TIME_REMAINING<>'0'
  group by sl.serial#,SL.TIME_REMAINING,SL.ELAPSED_SECONDS,SL.START_TIME,SL.SQL_ID, S.SQL_TEXT, se.sid,
  sl.opname, sl.SOFAR, sl.TOTALWORK, sl.MESSAGE, se.USERNAME, se.OSUSER, se.MACHINE, se.PROGRAM
  order by se.sid,sl.serial#
