I am wondering how people are deleting schema locks? We are on oracle 11g and SDE 10.1. I have been using a sql delete query run from TOAD to do it for users that have read only connections...
Natalie thank you, good example and good cautionary info to know.
Now, how about if it is for read-only... would there be any reason why not to disable them in this case?
in our case, we use locks because if the schema changes while folks have data offline in field-editing workflows, they can't sync... the replica would become corrupt.
by the way Kory Kramer I have read through these threads. There really needs to be a button I can click, to show exactly what services (all of them) are using a feature class in SDE. So I can then know which ones to stop. Not a long thing I have to do in python, do not have time for that. I have lots, lots of services and layers and databases.
Is there any reason not to set it to disable schema locks? Maybe a silly question but if it's as simple as disabling schema lock as an option, why can't that the default? Not seeing the new fields until republishing does't seem like a downside, I would take the tradeoff, it can be hard to track down all the services using a feature class. In fact , there should be a button I can click to show all the services using a feature class. (Not users, but services, since that's what actually drives it, that should be possible)
But how do you keep the users from reconnecting. I have the box unchecked that says the Geodatabase is accepting new connections and yet my GIS server reconnects on longer GPs.
We're on Oracle 11g and 10.2.2 and have always been able to disconnect everyone either using ArcCatalog administration or arcpy.DisconnectUser(). Not sure if you noticed but when you're in the Connections tab of geodatabase administration, you can Ctrl+A all connections and right click to disconnect all (although you have to Ctrl+click to deselect your own connection). You can also do this when viewing the Locks tab and disconnect everyone with locks on a particular feature class.
Thanks Forest, you should be able to remove all the users pretty quickly using the following arcpy command.
gdb <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'Database Connections\w1041.sde'</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>DisconnectUser<SPAN class="punctuation token">(</SPAN>gdb<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'ALL'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
DisconnectUser—ArcPy Functions | ArcGIS for Desktop
The SDE command line tools have a similar function, but as they are deprecated, it may be best to start working with the arcpy module.
Christian Wells wrote:Schema locks should only be managed through the ArcGIS clients.
Christian Wells wrote:
Schema locks should only be managed through the ArcGIS clients.
That, in a nutshell, is what our technical lead said. But it does not work on our system.
Even if the ArcCatalog approach was working as expected it would still be inefficient. Sometimes I will have 200 locks that I need to kill in order to update a database. Selecting them by hand off the lock table would be tiresome and prone to error. What are the other options? SDE command line? arcpy?
Christian Wells wrote:Are they being orphaned?
Are they being orphaned?
No, they are not being orphaned.
Schema locks should only be managed through the ArcGIS clients. If locks need to be removed, the supported and recommended way is to disconnect users via the Geodatabase Administration window in ArcGIS Desktop.
Manage geodatabase locks—Help | ArcGIS for Desktop
What is happening that requires locks to be removed via SQL? Are they being orphaned?
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.