web analytics

Oracle: who is connected to the server

Here is the simple query, showing who is connected to the server.

col username FOR a15
col program FOR a25 trun

SELECT sid, serial#, username, program, SUBSTR(module,1,10) module, logon_time
FROM v$session
ORDER BY 1,2;

This is almost the same query, limiting the output to the active users:

SELECT sid, serial#, username, program, SUBSTR(module,1,10) module, logon_time
FROM v$session
WHERE status = 'ACTIVE'  
ORDER BY 1,2;

It’s important to set “MODULE” field for the running sessions. It makes the output more clear.
The setting could be done with the following command:

EXEC DBMS_APPLICATION_INFO.SET_MODULE( module_name=>'&module',action_name=>'&action' );

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.