Locating Schema locks caused by Services

10-27-2021 08:03 AM
Status: Open
Occasional Contributor

I am looking for a way to find out which services are consuming GDB feature classes and causing schema locks.

From ESRI:
As mentioned, I have discussed the query, with the specific team who looks into these queries, and has received a response that the functionality of viewing which services are acquiring the schema locks is unavailable. Also, to remove schema locks from ArcGIS Server service, you can start and stop the services and the locks shall be removed.

I would like to be able to trace a feature class that is locked by one or many services.  We don't have a lot of issues with locks in Desktop per se, but it is a matter of finding which services specifically to shut down to clear the locks.  My only option now is to shut down all three of my ArcGIS Server Services, causing entire Portal to be effectively shut down.  This cannot happen during the day with people using our services throughout the City as we have developed many maps, apps and dashboards for City Departments and Residents to use as well as other Software platforms that utilize ESRI services.  

I am hoping somebody can make an interface that can search through the services for data sources that are locking the GDB Schema to limit what I am having to shut down.


@bsanders69 I'm not sure if this tip will help you, but you could try and open the task manager on your ArcGIS Server machine:

In the Details tab, you will see a load of ArcSOC.exe processes running. One for every service. If you Add a column called "Command Line" to the table, you can see where each ArcSOC originates from. 




How did you publish your map service ? In ArcGIS Pro you need to make sure enable schema locking isn't ticked 




That box you are mentioning, is a potentially dangerous thing based on a conversation with ESRI Support.  It was designed around read-only reference data that will never change.  Certain schema changes can cause services to act erratically if the underlying data structure is changed and service is not turned off and started again to get a push of the correct schema.  



Interesting, we've been using this for years and not had any problems but will bear in mind.



For Brooks_SummitGeo:

Your example screenshot did not include an ArcSOC.exe process running, but We discussed this with Support.  We simply have too many services (hundreds to date and many that use a lot of common data, so overlapping is an issue) to sort through for this process to work effectively.  I am looking for a forward solution, rather than a backward one.  I see a schema lock in my database, can I plug that data source into a tool that will provide me a list of services in my enterprise that consume that data.


For GillWare:

It is something I looked into and discussed with Support.  It is an option, but I would also hate to try and chase down a funky acting service problem...especially with so many services running so far.


System Log Parser would give you all the datasources of all your services based on your system logs. Should set your logs to verbose, then get a scan of your system logs, then can set it back to warning.

See screenshot:



SLP looks like this: 



Download here:




 Couldn't you get the information from the service manifest?

Something like this, using the ArcGIS API for Python.

gis = GIS(portal_url, portal_user, portal_pwd, verify_cert=False)
servers = gis.admin.servers.list()
server1 = servers[0]
services = server1.services.list(folder="abc")
service = services[0]
item_info = service.iteminformation
manifest = item_info.manifest