Sunday, December 23, 2012

Active Sessions more than 3 hrs

col USERNAME for a10


 
col MACHINE for a15

 
col PROGRAM for a25

 
set line 400

 
SELECT USERNAME,machine,inst_id,sid,serial#,

 
PROGRAM,

 
to_char(logon_time,'dd-mm-yy hh:mi:ss AM')"Logon Time",

 
ROUND((SYSDATE-LOGON_TIME)*(24*60),1) as MINUTES_LOGGED_ON,

 
ROUND(LAST_CALL_ET/60,1) as Minutes_FOR_CURRENT_SQL

 
From gv$session

 
WHERE STATUS='ACTIVE'

 
AND USERNAME IS NOT NULL  and ROUND((SYSDATE-LOGON_TIME)*(24*60),1) > 180

 
ORDER BY MINUTES_LOGGED_ON DESC;

No comments: