Oracle Sessions

SQL Statement

select 100 * num_sessions / max_sessions pct_sessions_used
from (
   select p.value max_sessions, count(1) num_sessions
   from v$session s, v$parameter p
   where p.name='sessions'
   group by p.value)

 

 

Description

 

Counts the number of user sessions currently connected to the database and alerts the "DBAs" when close to the maximum allowed by the database, i.e. close to the value of the sessions parameter.