Tuesday, April 05, 2011

Kill Oracle Session

Total Number Of Active Sessions: - 

ps -ef|grep -i applvis|wc -l

First Way via SQL* PLUS utility: -

SQL> select username,sid,serial#,terminal from v$session;
SQL> alter system kill session ‘SID, SERIAL#’;

************************** **************************

Second Wayvia KILL Command (for Unix/Linux)  : -


SELECT s.sid,p.spid, s.osuser, s.program
FROM v$process p, v$session s
WHERE p.addr = s.paddr
and s.sid=&your_given_sid;


Then issue the KILL Command
$ kill -9 SPID

[Note: Do not kill the sessions at the OS level (as per as possible). 

************************** **************************


Third Wayvia ORAKILL Command (in Windows command prompt) : -

SELECT s.sid,p.spid, s.osuser, s.programFROM
v$process p, v$session s
WHERE p.addr = s.paddr
and s.sid=&your_given_sid;

Then issue the orakill Command
C:\> orakill ORACLE_SID SPID

[Note: Do not kill the sessions at the OS level (as per as possible).

************************** ************************** 


Regards,
Sukhwinder singh

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

There was an error in this gadget