SQL Script to find Queries Running More than 30 seconds

This script will help to find queries that are running more than 30 seconds under APPS schema


SELECT distinct s.username,Q.SQL_ID,round(s.last_call_et ,2) Time_in_seconds,round(s.last_call_et / 60,2) Time_in_mins,s.sid,s.serial#,s.inst_id
    FROM gv$session s
         JOIN gv$sqltext_with_newlines q ON s.sql_address = q.address
   WHERE status = 'ACTIVE' AND username like '%APPS%' AND TYPE <> 'BACKGROUND' AND s.last_call_et  > 30 
ORDER BY s.inst_id;

If you like please follow and comment