Program Connection Count by Username (pgmcntu.sql)
The Script
Section titled “The Script”rem pgmcntu.sqlremttitle 'Program Connection Count By Username'remset lines 200set 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'remselect inst_id , username , program , machine , count(*) cnt from gv$session s where upper(s.username) like nvl( upper('&username'), '%') and (program not like 'oracle%' or program is null)group by inst_id, username, program, machineorder by username, inst_id, program, cnt desc/
Parameters
Section titled “Parameters”The script prompts for:
- username: Username pattern (% for all users)
Related Scripts
Section titled “Related Scripts”- pgmcntu2 - Enhanced version with service names