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.





Leave a reply to Ben Cancel reply