Users Online at a particular time duration

Viewpoint
Enthusiast

Users Online at a particular time duration

Hi,

Is it possible to see that how many users were online on a particular day during a limited time period?

2 REPLIES
Junior Contributor

Re: Users Online at a particular time duration

Hi Mohammad,

what do you mean by "online"?

Logged on to your Teradata system? 

dbc.LogonoffV keeps the history of sessions, there's a row with LogonDate/LogonTime for Event = 'Logon' and another for Event = 'Logoff' with LogDate/LogTime plus the LogonDate/LogonTime.

Teradata Employee

Re: Users Online at a particular time duration

You can try

Eg.  active sessions today between 9:00:00 and 9:30:00

SELECT  username, sessionno,

logdate,

MAX(CASE WHEN event ='logon' THEN logtime ELSE NULL END) AS time_start,

MAX(CASE WHEN event ='logoff' THEN logtime ELSE NULL END) AS time_end

 FROM dbc.LogonoffV   

 WHERE logdate = CURRENT_DATE

 HAVING  time_start  <= 093000

 AND   time_end  >=  090000 

 GROUP BY 1,2,3