Friday, August 1, 2008

Script to Check the number of session-----------

Sript to Check the number of session running on the database
------------------------------------------------------------

SQL>set pages 100
SQL>set lines 3000
SQL>col machine format a25
SQL> col username format a15
SQL>col program format a25
SQL>break on 1;
set heading off;
SQL>select 'Sessions on database ' d.name ' having instance name ' i.instance_namefrom v$database d,v$instance i;
set heading on;
compute sum label 'Total Sessions' of sessions on 1
SQL>select 1,username,machine,program,count(*) sessionsfrom v$session group by username,machine,program
order by username,sessions desc;

No comments: