Iceberg
Iceberg

Reputation: 101

How to see database connections as a regular developer?

How can a regular developer, without admin privileges on the database, see active db connections - particularly the ones "owned" by them? Not sure if that is the right db terminology. (Application written in Java with JDBC, Oracle, and SQL Plus).

Upvotes: 0

Views: 90

Answers (1)

Justin Cave
Justin Cave

Reputation: 231651

You don't need admin privileges but you would need to have permission to query the V$SESSION table (GV$SESSION if you happen to be using RAC). Your DBA can grant you the privilege to query just that table

GRANT SELECT ON sys.v_$session TO <<your user name>>

or the DBA can grant your user the SELECT ANY DICTIONARY privilege or the SELECT_CATALOG_ROLE role.

If you have one of those grants, you should be able to query V$SESSION to see all the sessions in the database.

SELECT sid, serial#, username, osuser, machine, terminal, program
  FROM v$session
 WHERE username = <<some user name>>

will show all the sessions in the database opened by a particular user.

Upvotes: 1

Related Questions