Select to view content in your preferred language

Kill SDE connections using a batch file:

1141
2
05-10-2012 06:46 AM
JeremyRead
Emerging Contributor
Does anyone have an example of how to kill specific SDE connections using a batch file?  Basically, I manually kill certain connections throughout the day to keep our server from maxing out during peak hours. 

The connections are searched by username: sdemon -o info -I users -i esri_sde2 | find "username"

Then killed:  sdemon -o kill -i esri_sde2 -N -p password -t <S-ID>

I have used batch files for various things in the past, but this particular one is challenging.  I was reading about using delimiters to find particular parts of a string, etc. and my head almost exploded.  Does anyone have an example that I could use to get started?

Thanks 🙂
0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor
Hi Jeremy,

If you are running ArcSDE for SQL Server, you can try a python script I created.  You can download it from here.  I have not extensively tested it, so please let me know of any feedback.
0 Kudos
JeremyRead
Emerging Contributor
Hi Jake,

Thank you very much for the link!  We are running Oracle here, but I will see if I can modify the script to work for us.

Cheers 🙂
0 Kudos