Locating Schema locks caused by Services

2325
8
10-27-2021 08:03 AM
Status: Open
bsanders69
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.

8 Comments
David_Brooks

@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. 

Brooks_SummitGeo_0-1635348074892.png

 

GillWare

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

GillWare_0-1635348344271.png

 

bsanders69

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.  

 

GillWare

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

 

bsanders69

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.

bsanders69

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.

NathanEnge

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:

NathanEnge_0-1635351976205.png

 

SLP looks like this: 

NathanEnge_1-1635352041304.png

 

Download here:

https://www.arcgis.com/home/item.html?id=90134fb0f1c148a48c65319287dde2f7

 

CarstenB_orsted

 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
pprint.pprint(manifest)