Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Q: Idle time of sessions
In article <567.430T497T11382532_at_rheingau.netsurf.de>,
Lothar Armbrüster <lothar.armbruester_at_rheingau.netsurf.de> wrote:
>Hello out there,
>
>I'm wondering how to get the time a specific Oracle session is idle.
>In v$session I can find the logon time but there is no information about
>the idle time.
>I looked in all_tab_columns for a column_name like %IDLE% but did not find
>anything useful.
>As I know that one can limit the idle time using profiles, I think it must
>be possible to find out that time.
>Any ideas?
Well, you can know the last NON_IDLE time from
select sid, to_char(sysdate - (hsecs-s.value)/(24*3600*100)
from v$sesstat s, v$statname n, v$timer
where n.name = 'process last non-idle time'
and n.statistic# = s.statistic#
and s.value !=0;
according to the advanced oracle tuning book. I would expect the difference
between that and the current time would be idle time. This would make a
test for idle time a lot simpler than constantly updating an idle time.
>
>Thanks in advance,
>Lothar
>
>--
>Lothar Armbrüster | lothar.armbruester_at_rheingau.netsurf.de
>Schulstr. 12 | lothar.armbruester_at_t-online.de
>D-65375 Oestrich-Winkel |
>
--
These opinions are my own and not necessarily those of Information Quest
jgarry@eiq.com http://www.informationquest.comhttp://ourworld.compuserve.com/homepages/joel_garry "See your DBA?" I AM the @#%*& DBA! Received on Wed May 06 1998 - 16:36:07 CDT
![]() |
![]() |