Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Finding concurrent users at noon
Hi
I have to know how many users were connected to a database at every full
hour.
With the following select ...
SELECT
to_char(TIMESTAMP, 'YYYY') YYYY, to_char(TIMESTAMP, 'MM') MM, to_char(TIMESTAMP, 'DD') DD, to_char(TIMESTAMP, 'HH24') HH, -- or LOGOFF_TIME count(TIMESTAMP) LOGINS FROM DBA_AUDIT_SESSION WHERE TIMESTAMP >= to_date('03.01.1997 07:00:00', 'DD.MM.YYYY HH24:MI:SS') AND TIMESTAMP < to_date('03.01.1997 19:00:00', 'DD.MM.YYYY HH24:MI:SS') GROUP BY to_char(TIMESTAMP, 'YYYY'), to_char(TIMESTAMP, 'MM'), to_char(TIMESTAMP, 'DD'), to_char(TIMESTAMP, 'HH24');
... I only get the number of users, that did login/logoff in the time
between HH:00:00 and HH:59:59.
YYYY MM DD HH LOGINS
---- -- -- -- --------
1997 01 03 07 7 1997 01 03 08 1 1997 01 03 09 3 1997 01 03 10 7
What helps?
Stefan
![]() |
![]() |