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

Home -> Community -> Usenet -> c.d.o.server -> Finding concurrent users at noon

Finding concurrent users at noon

From: Stefan Schindler <stefan.schindler_at_bernoise.ch>
Date: 1997/05/23
Message-ID: <33858A84.6B36@bernoise.ch>#1/1

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



Stefan Schindler stefan.schindler_at_bernoise.ch CH-3001 BERNE, Switzerland
Received on Fri May 23 1997 - 00:00:00 CDT

Original text of this message

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