Tuesday, 30 June 2015

arcgis desktop - Is there automated way of releasing all ArcSDE layers locks?


We have an issue where users do not close ArcGIS and layers get locked, and sometimes this affects our nightly updates for some of the layers. I know you can individually remove a lock using the ArcSDE command (which we do), but does anyone know of a way I can create a script that can be run every night to get rid of the locks?


We are running ArcSDE 9.2 and ArcGIS Desktop 9.3.1.



Answer



For this scenario I run the sdemon command from a python script using the following:


import subprocess
#Kill all ArcSDE connections
subprocess.call('sdemon -o kill -t all -u -p -N', shell=True)



#Kill all Direct Connections, (ArcGIS 10.0 only)
subprocess.call('sdemon -o kill -t all -i sde:sqlserver:SERVERNAME-u -p -D sde -N', shell=True)

No comments:

Post a Comment