Oracle 12c Database V$session values

2.9k Views Asked by At

Why was I seeing more than the active no. of connections in V$SESSION view? I am connected through SQL Developer and EM Express only but in V$SESSION its showing four connections with different SIDs. But after some more time it came to two connections. V$SESSION is dynamic View then why did it take that much time in update?

thanks

1

There are 1 best solutions below

8
On BEST ANSWER

I think you use such a query

select *
 from v$session v
where ( v.USERNAME not like 'SYS%' and v.USERNAME != 'DBSNMP' )
  and  v.STATUS = 'ACTIVE' 
order by v.LOGON_TIME desc;

to display active sessions, and perhaps your database is of RAC(Real Application Clusters) type, and need to replace v$session with gv$session which shows more than one instances with inst_id column at the beginning of the select list.