Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: find disconnected sessions

Re: find disconnected sessions

From: <alifiemylarder1_at_hotmail.com>
Date: Thu, 16 Jan 2003 11:17:20 GMT
Message-ID: <3E269398.1663BD65@hotmail.com>


select ....
and sysdate = LOGON_TIME

can't return anything since LOGON_TIME is unlikely equal to SYSDATE (the precision is one second), instead use

select ....
and trunc(sysdate) = trunc(LOGON_TIME)

Hartmut Wieczorek wrote:

> Hi All
> my problem is to find all the disconnected oracle sessions to kill them.
>
> I'm scripting on my UnixSystem fine but the only problem is to find those
> disconnected users.
> I want to select all this user processes with a v$session.LOGON_TIME older
> than dual.sysdate
> (maybe 2 days older). I try the following :
>
> SELECT spid, osuser, s.program, schemaname, LOGON_TIME
> FROM v$process p, v$session s, dual
> WHERE p.addr = s.paddr
> and s.program = 'JDBC Thin Client' <- this are our Clients
> and sysdate > LOGON_TIME ;
>
> but I get many rows from this statement with LOGON_TIME '16.01.03'
> when select sysdate from dual is 16.01.03.
>
> when i try
> select ....
> and sysdate = LOGON_TIME ;
> the result is empty.
>
> whats wrong ? can somebody help me?
> best regards
> Hartmut
Received on Thu Jan 16 2003 - 05:17:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US