Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







Display Oracle session volume per minute

Oracle Database Tips by Donald BurlesonApril 18,  2015

Ever need to know the number of sessions per minute?  This information is critical for Oracle tuning because understanding the number of active sessions over time is invaluable for Oracle capacity planning.  This script below produces a listing of all active session per minute over time. 

For complete scripts for plotting Oracle metrics, see The Oracle script collection.

When plotted, a chart of sessions per minute reveals important insights into Oracle performance under stress.  This sessions per minute script uses the ASH table and the concept that dbtime (s) / duration (s) = active sessions per second:



SNAPTIME                 Duration (s) Avg Active Sessions/min

------------------------------ ------------ ----------------------

17-APR-09 AM        3601.452              5.87

17-APR-09 AM        3601.465              7.12

17-APR-09 AM        3601.469             14.31

17-APR-09 AM        3601.514             29.89

17-APR-09 AM        3601.656              42.2

17-APR-09 AM        3602.636             39.52

17-APR-09 AM        3602.888             36.28

17-APR-09 AM        3601.818             39.27

17-APR-09 PM        3603.324             39.33

17-APR-09 PM        3603.482             90.04

17-APR-09 PM        3543.031             45.39



STATSPACK - Oracle sessions per minute


This script uses the free STATSPACK tables to compute session activity:

set linesize 150



Example Output:


SNAPTIME         Duration (s) Avg. Active Sessions/min

-------------------- ------------ ------------------------

19-APR-2009 05:00:05         3604               1.99

19-APR-2009 06:00:07         3602               2.46

19-APR-2009 07:00:04         3597               8.31

19-APR-2009 08:00:02         3598               2.03

19-APR-2009 09:00:01         3599               1.98

19-APR-2009 10:00:01         3600               1.98

19-APR-2009 11:00:00         3599                2.4




with sessiondata as (

  select snaptime,

  snaptime - lag(snaptime) over (order by snaptime) duration,

  dbtime - lag(dbtime) over (order by snaptime) timedelta

  from (

    select s.snap_time snaptime,

    (select sum(time_waited_micro) / 1000000 from stats$system_event se where event not in (select event from stats$idle_Event)
see code depot for full script

      and se.snap_id = s.snap_id and se.dbid = s.dbid and se.instance_number = s.instance_number) +

    (ss.value / 100) dbtime

    from stats$snapshot s, stats$sysstat ss

    where s.snap_id = ss.snap_id and s.dbid = ss.dbid and s.instance_number = ss.instance_number

    and s.dbid = (select dbid from v$database)

    and s.instance_number = (select instance_number from v$instance)

    and = 'CPU used by this session'



select to_char(snaptime, 'DD-MON-YYYY HH24:MI:SS') snaptime, duration * 86400 "Duration (s)",

round((timedelta / (duration * 86400)) * 60, 2) "Avg. Active Sessions/min"

from sessiondata





ASH - Sessions per minute


 This script uses ASH to determine sessions per minute, using dba_hist_active_session_history:



set linesize 150

column snaptime format a30


with sessiondata as (select snaptime, dbtime / 1000000 dbtime,

  (extract(day from duration) * 86400) +

  (extract(hour from duration) * 3600) +

  (extract(minute from duration) * 60) +

  extract(second from duration) duration

from (

  s.begin_interval_time snaptime, s.begin_interval_time - lag 
 (s.begin_interval_time) over (order by s.begin_interval_time) duration,

  tm.value - lag(tm.value) over (order by s.begin_interval_time) dbtime

   dba_hist_snapshot s,
   dba_hist_sys_time_model tm

see code depot for full script


   s.snap_id = tm.snap_id

   s.instance_number = tm.instance_number

   s.dbid = tm.dbid

   s.instance_number = (select instance_number from v$instance)

   s.dbid = (select dbid from v$database)

   tm.stat_name = 'DB time'

   s.snap_id between &beginsnap and &endsnap


   duration "Duration (s)", round((dbtime / duration) * 60, 2) "Active Sessions/min"






Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.