Script to check Running database operations in oracle database

Script to check Running database operations in oracle database.

This script will provide you the details that what all operations working in background and what all those session related to, it will show Percent Complete work and TIME_REMAINING to complete ongoing task.

col OPNAME format a30
col SOFAR format 99999999999999999
col TOTALWORK format 9999999999999999
col username format a12
col event format a21
select s.sid,s.serial#,s.username,l.opname,l.SOFAR,l.TOTALWORK,
round(l.SOFAR100/l.TOTALWORK) “Percent Complete”, l.TIME_REMAINING from gv$session_longops l,gv$session s where round(l.SOFAR100/l.TOTALWORK) <> 100
and s.sid=l.sid and s.status=’ACTIVE’ and l.TOTALWORK <> 0 order by 6
/

Sample Output-

Leave a Reply

Your email address will not be published. Required fields are marked *