Script to check GSS Percentage

Script to check GSS Percentage

set lines 200
set pages 200
col SID for a10
col OPNAME for a30
col START_TIME for a25
col EST_COMPL for a25
select sid||','||serial# SID,opname,sofar,totalwork,round((sofar/totalwork)*100,2)
perc_compl, to_char(START_TIME,'DD-MON-YY HH24:MI:SS') Start_time, to_char(sysdate
+TIME_REMAINING/60/60/24,'DD-MON-YY HH24:MI:SS') est_compl from gv$session_longops where opname
like '%Statistics%' and sofar <> totalwork and totalwork !=0 order by est_compl;