Count number of sessions oracle

— Count number of sessions oracle for 7 days, Provided you keep data that long —

select to_char(BEGIN_INTERVAL_TIME,'HH24'), ROUND(SUM(CURRENT_UTILIZATION)/COUNT(*))
FROM DBA_HIST_RESOURCE_LIMIT l,
DBA_HIST_SNAPSHOT ss
where
ss.SNAP_ID = l.SNAP_ID
AND l.RESOURCE_NAME LIKE 'sessions'
AND STARTUP_TIME between sysdate-7 and sysdate+1
GROUP BY to_char(BEGIN_INTERVAL_TIME,'HH24')
ORDER BY 1 asc;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s