Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: find disconnected sessions
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