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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Killing all sessions on an Instance

Status
Not open for further replies.

SJTech

Programmer
Jul 3, 2001
26
GB
I am fairly new to Oracle so forgive me if this is a really simple question.

Is there a way that I can kill ALL sessions logged on without having to enter in the sid AND serial# for every session open.

Gary
Staff Officer(IT)
 
if you drop SQL*net you will drop all remote sessions, that is what I do if I get a deadlock while I am away from the office. Sessions started on the host are still active but no other computers' sessions survive I love everyone til they prove otherwise, sadly some prove otherwise SO quickly
 
Forgive my ignorance. If I drop SQL Net I assume you mean stop the service. What if I have multiple instancez running on the same server if I drop it will it not drop ALL users from ALL sessions not just the instance I require.

:cool:


Gary
Staff Officer(IT)
 
I have not met an Oracle version that did not grab my entire server, so I am afraid I dont have positive experience with mutiple instances I love everyone til they prove otherwise, sadly some prove otherwise SO quickly
 
If you kill ALL sessions, you kill Oracle internal processes. So isn't it better to shutdown the instance? If you mean only user sessions, you may loop through v$session where username is not null. You must also kill your own session after killing all others. To find your session select from v$session where audsid=userenv('sessionid').
 
The last time I tried to kill my own session, Oracle gave me an exception indicating I can't kill my own session. Of course, it's easy to kill your own session - log off!
 
Oops, it was a bit MORE than good idea to kill own session :). Thanks, Carp!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top