Oracle AWR report reports number of sessions, below is an example:

Where does Oracle collect Session Data?

I conduct a sample experiment by run the following queries:

-- Count the current number of sessions:
SELECT COUNT(*) FROM V$SESSION;

-- Get the current number of logons:
SELECT * FROM V$SYSSTAT WHERE NAME = 'logons current';

-- Create a snapshot manually:
EXEC DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT();

-- Query the snapshot data:
SELECT SNAP_ID, VALUE
FROM DBA_HIST_SYSSTAT
WHERE STAT_NAME = 'logons current'
  AND SNAP_ID = (SELECT MAX(SNAP_ID) FROM DBA_HIST_SNAPSHOT);

Observations from the experiment: Oracle collects session statistics from the DBA_HIST_SYSSTAT table, specifically from the row where STAT_NAME = 'logons current'. This value, in turn, originates from the V$SYSSTAT view, which reflects the current number of logons as counted by the number of records in the V$SESSION table.

Understanding Logons and Logouts

In my example:

  • At the start of the interval, there were 8392 active sessions.
  • At the end of the interval, the number of sessions increased to 10893.

This indicates an increase of 2501 sessions over a 30-minute interval. Breaking this down, the session count increased by approximately 1.389 sessions per second:

2501 sessions / (30 minutes × 60 seconds) = 1.389 sessions per second

In the AWR report’s Load Profile section, it was reported that there were 11.2 user logons per second.

This raised a question: if the session count increased by only 1.389 per second, where did the rest of the logons go?

The answer lies in the logout operations. In the Instance Activity Stats section of the AWR report, it was observed that there were 9.85 users logout operations per second.

This explains the discrepancy: Net session change per second = Logons per second – Logouts per second

Key Takeaway: Snapshot Session Counts vs. Session Activity

The session numbers corresponding to AWR snapshots (e.g., 8392 at the start and 10893 at the end) represent the number of active sessions at the specific time the snapshot was taken. These values do not account for session activity—such as logons and logouts—that occurred during the interval between snapshots.

To get a complete picture of session dynamics, you should drill down into session-related statistics in the Load Profile and Instance Activity Stats sections to understand session behavior over time.

5 responses to “Understanding Session Statistics in Oracle AWR Reports”

  1. Krishna Yadav avatar
    Krishna Yadav

    just taught , if logouts are higher compared to logins then end_snap value should be less in sessions section ?

    Like

    1. YuanOracleACE avatar

      You are surely right.

      Like

      1. Krishna Yadav avatar
        Krishna Yadav

        Any idea why sessions are high in endsnap ….

        Like

  2. Ben avatar
    Ben

    What is a query that can be run that will pull the exact same time/# as the “Sessions” timestamp/value in the AWR report? I.e. in the example above, one of the rows of output from the query would be “20-Nov-24 20:30:38,8392”

    Like

    1. YuanOracle avatar

      SQL> SELECT COUNT(*) ,sysdate from v$session;

      COUNT(*) SYSDATE 113 2025-06-20 15:00:51

      SQL> SELECT value FROM V$SYSSTAT WHERE NAME = ‘logons current’;

      VALUE 113

      Like

Leave a comment

I’m Yuan

Welcome to the blog of a performance maven in Oracle & MySQL. Feel free to contact me to share and discuss database knowledge.

My 20 Oracle Certifications

A screenshot from certview.oracle.com

My Book

MySQL 8.0 Operations and Optimization

Let’s connect