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 […]

Oracle: kill session

The command to kill Oracle is simple:

ALTER SYSTEM KILL SESSION ‘&sid,&serial’;

sid – session ID serial – session serial number

If the version 11g and this is RAC, additional syntax is possible:

ALTER SYSTEM KILL SESSION ‘&sid,&serial,@&inst_id’;

inst_id – instance id number (1, 2, 3 …)

Script to find the […]