Skip to Main Content
  • Questions
  • Number of connections and sessions in a given time

Breadcrumb

May 4th

Question and Answer

Chris Saxon

Thanks for the question, Geraldo.

Asked: April 03, 2020 - 4:00 pm UTC

Last updated: April 09, 2020 - 1:12 am UTC

Version: 18.6

Viewed 10K+ times! This question is

You Asked

Hello, Ask Tom Team.

I would like to know the number of sessions and connections to an Oracle database in a given time.

Thanks in advanced.

and Connor said...

The database will capture a critical statistic here for you. "Average Active Sessions".

Here's a great slide deck on the background and importance of that statistic

https://www.slideshare.net/jberesni/average-active-sessions-rmoug2007-37554537

Note that "connected sessions" is not the same as "active sessions". Active is someone doing something on the database *right now*, not just sitting there connected.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

dba_hist_resource_limit

Mikhail Velikikh, April 06, 2020 - 9:31 am UTC

Hi,

If you are looking for the number of sessions, then there are two AWR views that can help:

1. DBA_HIST_RESOURCE_LIMIT where resource_name = 'sessions':
https://docs.oracle.com/en/database/oracle/oracle-database/20/refrn/DBA_HIST_RESOURCE_LIMIT.html#GUID-CEC222A1-AC6C-4B27-8F3A-4E69304AC25F

2. DBA_HIST_SYSSTAT where stat_name = 'logons current'
Connor McDonald
April 09, 2020 - 1:12 am UTC

nice input

Follow Up

Geraldo, April 08, 2020 - 2:17 am UTC

Thanks for your responses.

I will check this info.
Chris Saxon
April 08, 2020 - 8:14 am UTC

You're welcome.

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library