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

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Geraldo.

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

Answered by: Connor McDonald - Last updated: April 09, 2020 - 1:12 am UTC

Category: Database Administration - Version: 18.6

Viewed 100+ times

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 we 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.

and you rated our response

  (2 ratings)

Reviews

dba_hist_resource_limit

April 06, 2020 - 9:31 am UTC

Reviewer: Mikhail Velikikh from Dublin, Ireland

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

Followup  

April 09, 2020 - 1:12 am UTC

nice input

Follow Up

April 08, 2020 - 2:17 am UTC

Reviewer: Geraldo

Thanks for your responses.

I will check this info.
Chris Saxon

Followup  

April 08, 2020 - 8:14 am UTC

You're welcome.

More to Explore

PL/SQL

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