Oracle Session Statistics Report
Displays statistics for the current database session, filtered by a statistic name or showing all statistics. Useful for analyzing session behavior and monitoring performance metrics in real time.
oraclesqlperformance-tuningv1.0.0
0 stars0 downloads5 views0 comments
By OracleDba • Created
Code
(18 lines)123456789101112131415161718
-- -----------------------------------------------------------------------------------
-- File Name : https://oracle-base.com/dba/monitoring/session_stats.sql
-- Author : Tim Hall
-- Description : Displays session-specific statistics.
-- Requirements : Access to the V$ views.
-- Call Syntax : @session_stats (statistic-name or all)
-- Last Modified: 03/11/2004
-- -----------------------------------------------------------------------------------
SET VERIFY OFF
SELECT sn.name, ss.value
FROM v$sesstat ss,
v$statname sn,
v$session s
WHERE ss.statistic# = sn.statistic#
AND s.sid = ss.sid
AND s.audsid = SYS_CONTEXT('USERENV','SESSIONID')
AND sn.name LIKE '%' || DECODE(LOWER('&1'), 'all', '', LOWER('&1')) || '%';