Deleted SDE layer keeps reappearing

432
8
01-11-2022 08:15 AM
Labels (3)
CraigFreeman2
New Contributor II

I have a point layer on a SQL Server Enterprise geodatabase that I can delete but reappears when I refresh catalog. 

0 Kudos
8 Replies
DS_GIS
by
New Contributor III

I have experienced this behavior before and it is usually due to SQL permissions. May I please inquire: what database connection are you using to delete the layer? i.e. are you using the connection who is the data owner to that layer?

0 Kudos
CraigFreeman2
New Contributor II

Yep, I'm using the data owner credentials.  This has happened sporadically and I can't find any clear reason for it.  

0 Kudos
HuubZwart
Occasional Contributor

I've seen the same behavior when the currenty logged in user is not licenced to edit SDE feature classes (at least ArcGIS Pro Standard is required). There's no error and the feature class seems to dissappear but then on refresh it's still there.

VinceAngelo
Esri Esteemed Contributor

If you use DROP TABLE in the database, you corrupt the Enterprise geodatabase metadata stored in the sde.sde_* and sde.gdb_* tables. It is these tables that "refresh" reads to generate lists. 

The easiest way to repair the corrupted geodatabase is to create tables with the same name (any table, with CREATE TABLE, just so it's there), then to delete the table properly via the ArcGIS UI or via arcpy.Delete_management.

- V

CraigFreeman2
New Contributor II

Sorry, I didn't see this response Vince.  I didn't DROP TABLE on the database side, but just the "Delete" option in Catalog when you right-click the point.  

I'm not sure I understand.   Assuming the geodatabase is corrupted, I need to create a table with the same name as the reappearing layer, and then delete via arcpy.Delete_management? 

0 Kudos
Bud
by
Regular Contributor III

I think it's a way of tricking SDE.

If the system tables for that FC are broken, then if you create a new FC in it's place, SDE will replace the broken system table data with new system table data. So hopefully when you delete the new FC this time, the system table data will be deleted successfully too. And then the FC will disappear from Catalog, which is what you want.
 

My limited experience is:

Sometimes these things take multiple attempts. And sometimes, if you just wait a few days, it resolves itself. I'm not an expert though. So I could be wrong.

0 Kudos
CraigFreeman2
New Contributor II

Thank you for the explanation.   Just to be clear, when you say "create a new FC in it's place", you mean a FC with an identical name?  If my faulty FC is "LandUse_2009", then I need to create another FC on the geodatabase called "LandUse_2009", then delete the new "LandUse_2009"?

0 Kudos
Bud
by
Regular Contributor III

Yeah, that’s what I meant. Hopefully it works.

0 Kudos