Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number of session logged into oracle db

Status
Not open for further replies.

nzcam

Programmer
Mar 5, 2003
36
NZ
Can anyone help me with locating the number of sessions currently logged on to an oracle instance/DB

Thanks
 
Cam,

Here is my "logins.sql" script that details each connected session:
Code:
set linesize 200
set echo off
set feedback on
col oruser format a20 heading "Oracle Username"
col osuser format a12 heading "O/S Username"
col ss heading "SID/Ser#" format a12
col time heading "Logon Date/Time" format a20
col computer heading "Computer/Terminal" format a21
col program format a50 heading "Program"
col process format 999999 heading "OS|Process|ID"
select     username oruser
   ,osuser osuser
   ,decode(substr(machine,1,7),'TENFOLD',substr(machine,9),machine) computer
   ,''''||s.sid||','||s.serial#||'''' ss
   ,status
   ,process
   ,to_char(s.logon_time,'yyyy/mm/dd hh24:mi:ss') time
   ,program
from       v$session s
order by time
/
ttitle off
Let us know if this is what you wanted.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top