File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sanmahicog sanmahicogg
Greenhorn
Posts: 2
  • 0
  • 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
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • 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).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic