To reduce unusual Memory and CPU consumption we rebuild a spatial index of feature class by following steps in below URL.Is there any way to automate these steps through any tool or services or anything?
URL - https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/modifying-a-spatial-index.htm#GUID-F9859FEE-F5BD-461E-9179-EFBFE9585C79
Yes, the thing with EGDB locks inside of ArcGIS Pro, it's entirely dependent upon ArcGIS Pro to manage them. So depending upon how the developers have coded Pro to manage locks from one version to the next, will result in GP tools working one way or another. My guess is, with newer tools and functions being developed every day in ArcGIS Enterprise and rolled out in updates, you will see functions that worked perfectly, sometimes for years, then suddenly stop working. I recently experienced such an issue with a very commonly used GP Tool, which was even part of a daily automation that served my entire organization. Took me days to figure out what broke it and how to work around it. Best of luck in your journey forward!
Thanks for the response. Yes this is an Enterprise GDB/branch versioned. I also run this model (use to at least) from an empty instance of pro with no feature classes loaded. I do have the enterprise actively connected though.
I dont have a great working knowledge of python, i can open existing code and monkey with it a bit to fit my connections/parameters but it still is pretty foreign to me. Do you see any issues with exporting the model builder to a python script and running it from there? Ultimately i would like to set up a windows task scheduler.
Well, I would need a little more info, I'm afraid. For instance, are you running the Model Builder against a file GDB or an Enterprise GDB? In either scenario, are you using them as part of a published service? If EGDBs: is it a multi-user environment?
In my experience, when you run into an issue where running a stand-alone GP tool will work, but fails in automation, it's generally due to a conflict in your sequence of operations; i.e., you run an Append GP Tool, then try to rebuild the spatial index, but the Append locked the GDB for edit and has not released the lock yet, so the spatial index tool fails because it also needs an exclusive edit lock. I've run into this kind of scenario most often when I have ArcGIS Pro open and running, and not so much when I am running a Python script from an external IDE. This is due to ArcGIS Pro holding GDB/Feature Classes in memory (presumably to make them more accessible) and until the stack refreshes, the locks persist. It is possible, with a bit of work, to run a Model Builder from an external Python script, which may be a work-a-round to scenarios like the one I described above.
Full disclosure: I don't work with Model Builder very often, although I do have uses for it when I need it. I am primarily a Python scripter for my automation needs, which I have found to be much more reliable for automation than Model Builder, as running a custom GP Tool seems to just work more consitently. With functions like arcpy.da.editor, that open and close edit sessions, it allows more flexibility in my sequence of operations. It would be really great if ESRI would build a GP Tool for that function, so users could add it to a Model Builder, but I digress.
@RandyCasey
When we first started rebuilding/analyzing data sets i set up a little model builder and it worked successfully. After some point the model threw the "cannot acquire a lock" error and stopped working. We are able to run the GP tool without an issue and we have recreated the model but still run into the error. Any idea what is happening here?
I have never needed to restart a service, but I have needed to take services offline in order to release database locks, which will stop an index rebuild.
@RandyCasey Thank you for your response. We are looking for a process that runs on a particulate date and time. Do we have to restart services after rebuilding indexes? We have to do it for 5 feature classes only.
@AmeliaBradshaw - Thank you for your response. We are using Enterprise Geodatabase. We will try to use the rebuild indexes tool and try to schedule it.
Depending on your definition of "automation", you have a couple of options. If you are looking for full automation, where the process runs on a particular date/time, a Python script set up to run from Windows Task Manager is probably your best bet. It's not an easy setup though and depending on your environment, you may have to deal with database locks due to versioning, stopping and starting ArcGIS Server services, etc. If you are looking for a semi-automated process, where you run a tool on a routine basis, you can use Model Builder to build a process. That may allow you to work with database locks and versioning a bit more easily, but it will still take some work.
Hello Manish, I saw that you had posted this as both an Idea and a question. This really fits better into the Question space, so I moved the Idea to the ArcGIS Pro Questions board. I now see you had already posted a question on this!
I have a question for you first. Are you working in an enterprise geodatabase? If so, you can use this tool: Rebuild Indexes (Data Management). If you are working in a different type of workspace, you could the tool Add Spatial Index (Data Management). This tool not only creates a spatial index, but can recreate an existing one as well.
Let me know if you have further questions!
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.