Oracle Session Statistics by SID Report

Displays performance statistics for a specific database session (SID). Useful for analyzing session-level resource usage and performance metrics during troubleshooting.

oraclesqlperformance-tuningv1.0.0
0 stars0 downloads10 views0 comments
By OracleDba • Created

Code

(16 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- -----------------------------------------------------------------------------------
-- File Name    : http://www.oracle-base.com/dba/monitoring/session_stats_by_sid.sql
-- Author       : DR Timothy S Hall
-- Description  : Displays session-specific statistics.
-- Requirements : Access to the V$ views.
-- Call Syntax  : @session_stats_by_sid (sid) (statistic-name or all)
-- Last Modified: 19/09/2006
-- -----------------------------------------------------------------------------------
SET VERIFY OFF

SELECT sn.name, ss.value
FROM   v$sesstat ss,
       v$statname sn
WHERE  ss.statistic# = sn.statistic#
AND    ss.sid = &1
AND    sn.name LIKE '%' || DECODE(LOWER('&2'), 'all', '', LOWER('&2')) || '%';

General Comments(0)

Tip: Click on a line number in the code to add a line-specific comment

No general comments yet. Be the first to comment!