cancel
Showing results for 
Search instead for 
Did you mean: 

killing tcp connections

 
eehess0
Occasional Visitor

killing tcp connections

How do you kill a tcp connection that shows up in netstat -a

4 REPLIES
Steven Schweda
Honored Contributor

Re: killing tcp connections

   Kill the process (at either end) which is using the connection?

   Is there some actual problem which you are trying to solve?

eehess0
Occasional Visitor

Re: killing tcp connections

The DBA were attempting a restore and there were connections to the Database from users computer that were still there and the users are not reachable.

Matti_Kurkela
Honored Contributor

Re: killing tcp connections

With most database types, there should be a DBA command that prevents the database from accepting new connections from regular users, and another command for killing existing connections.

 

Since some applications automatically re-establish a database connection if it's broken, it may be useless to try and kill the existing connections before the database is set to not accept new connections, as computers can set up new connections at least as fast as you can type commands to kill them.

 

With Oracle, the commands would be "alter system enable restricted session" to block new connections (other than by the DBA), and "alter system kill session" to kill the existing sessions. Other database types will have other commands for the same purpose. Your DBA really should know these commands and use them.

MK
Nighwish
Frequent Advisor

Re: killing tcp connections