col machine format a20
col program format a40
col osuser  format a10
col nu      format 9999

select count(*) nu, machine, program, osuser
from v$session
group by machine, program, osuser
order by 1, 2, 4
/
