Enhanced Program Connection Count by Username (pgmcntu2.sql)
What This Script Does
Section titled “What This Script Does”Enhanced version that includes service name information for comprehensive connection analysis.
The Script
Section titled “The Script”rem pgmcntu2.sqlremttitle 'Program Connection Count By Username'remset lines 250set pagesize 150remcol inst_id format 99 heading 'RAC|INST'col username format a30 heading 'Username'col program format a48 heading 'PROGRAM NAME'col cnt format 999,999 heading 'Count'col machine format a50 heading 'Machine'col service_name format a50 heading 'Service'remselect inst_id , username , program , machine , service_name , count(*) cnt from gv$session s where upper(s.username) like nvl( upper('&username'), '%') and (program not like 'oracle%' or program is null or program = '')group by inst_id, username, program, machine, service_nameorder by username, inst_id, program, cnt desc/
Parameters
Section titled “Parameters”The script prompts for:
- username: Username pattern (% for all users)