Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Qry for Number Of User Connected to SQL/Oracle Database.

 
sanmahicog sanmahicogg
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the query to find the no of user connected to Oracle database or SQL database ?
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

I'm afraid such functionality is vendor-specific. I cannot help with other databases, but in Oracle you might probably query the V$SESSION performance view (and count number of rows), although you need quite powerful privileges to be able to do this. There might even be a better dynamic view which would contain the aggregated number of sessions, you might want to look in more detail yourself.

Be careful when interpreting the number you get this way. Some users can have several active connections of their own, and conversely one connection can be shared by many users (if it is a connection managed by connection pool on an application server, for example).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic