wood burning stoves 2.0*
The moose likes JDBC and the fly likes Qry for Number Of User Connected to SQL/Oracle Database. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Qry for Number Of User Connected to SQL/Oracle Database." Watch "Qry for Number Of User Connected to SQL/Oracle Database." New topic
Author

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

sanmahicog sanmahicogg
Greenhorn

Joined: Jul 23, 2012
Posts: 2
What is the query to find the no of user connected to Oracle database or SQL database ?
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Qry for Number Of User Connected to SQL/Oracle Database.