Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need to track SQLs which are running more than 1 day

JhilJul 5 2023

Dear Experts,

Some Queries are running longer than usual.

We want to get which SQL Queries are running more than 24 hrs.

I am looking for better one to track SQL Statements which are running longer than 24 hrs

set linesize 170 pages 1000;
col "USERNAME|SID,SERIAL|MACHINE|STATUS" for a25;
SELECT username,sid, serial#,machine,status,TO_CHAR(CURRENT_TIMESTAMP,'HH24:MI:SS') AS curr,TO_CHAR(start_time,'HH24:MI:SS') AS logon,(sysdate - start_time)*24*60 AS mins
FROM V$SESSION_LONGOPS WHERE username is not NULL AND (SYSDATE - start_time)*24*60 > 1 ;

Any other Queries to find which SQL Statements are running longer than usual ?

Thanks in Advance.

Comments
Post Details
Added on Jul 5 2023
4 comments
430 views