Select to view content in your preferred language

ArcGIS Server 10.3 Question about deleting SDE feature class

5247
9
06-25-2015 04:54 AM
JonMurphy
New Contributor II

Hi all, 

I did something clumsy that I am looking to recover from. 

I'm on ArcGIS server 10.3 using Microsoft SQL Server and I deleted an SDE feature class in SQL server but not in ArcCatalog.  Now ArcCatalog still sees the SDE layer but won't let me delete it.  How do I delete that feature now?  (I had thought it was just a table not a feature class which was why I did it in the first place in SQL server)

-J

0 Kudos
9 Replies
AsrujitSengupta
Regular Contributor III

I would suggest calling Esri Tech Support, so that someone can guide you through the process of removing the orphaned entries from the database end.

Also take a Full database backup before trying anything on that database now.

  • What is the version of the sde geodatabase (10.2.x, 10.3.x..)?
  • Do you have ArcSDE Command Line tools installed?
0 Kudos
StevenGraf1
Regular Contributor

I found this post.

Delete all Tables in SDE / SQL Feature Class

The short answer is try recreating the table in SQL with the same exact name.  Go into ArcCatalog and see if you can then delete it.

I would definitely create a backup before you move forward.

-Steven

AsrujitSengupta
Regular Contributor III

Honestly, I don't think that will work. Still give that a try and check..

0 Kudos
VinceAngelo
Esri Esteemed Contributor

This is the best practice technique for deleting objects that no longer exist.  You don't even have be too picky about "recreating" the table ("CREATE TABLE foo (objectid INTEGER NOT NULL)" will suffice).

Of course, it won't recover the destroyed table the way going to backups would.

- V

JoeBorgione
MVP Emeritus

Assuming you run backups on your SQL database, why not restore it to the point just prior to your mistake and then delete the feature class?

That should just about do it....
JonMurphy
New Contributor II

Hi All,

I got a hold of Esri in Germany (I'm in Geneva) and this is what they told me:

So we've found the cause of the problem. If you delete a featureclass via SQL remain entries in at least 5 repository tables (GDB_ITEMS, SDE_LAYERS, SDE_TABLE_REGISTRY, SDE_COLUMN_REGISTRY, SDE_GEOMETRY_COLUMNS, etc.). The only way to be sure that all the data about your data gets properly removed is to use ArcCatalog.

To remove all these entries manually is very laborious. So the easiest way is to re-create it (dummy table with the same name) and delete the featureclass via ArcCatalog.

So it seems to pretty simple. I just made some dummy tables in SQL with the same schemas.  They connected in ArcCatalog but now I'm getting a permission issue. Seems I don't have the right to delete this particular SDE feature classes now. 

I get the message  DELETE FAILED

Failed to delete the selected Objects

Must be the owner to perform this operation.

So some permission thing going on now.

VinceAngelo
Esri Esteemed Contributor

Are you using Catalog to delete the tables in a connection as the table owner?  An owner should always have privileges to drop their own table.

- V

0 Kudos
JonMurphy
New Contributor II

So I figured it out.  We micromanage our database and each one has it's own login and I was logged into the wrong one.  We have to use keypass as we have over 30-40 logins to manage.

So we should be good. Thanks for all the help everyone

0 Kudos
JasonTipton
Occasional Contributor III

Totally "unsupported", but you just delete all the rows from the SDE/GDB tables that reference the table and its columns.

I had a table that wouldn't delete after adding a dummy table back in. I ended up just reading the ESRI docs on SDE databases, finding all the tables and deleted all references out. Works perfectly, but I do spend a lot of time on the backend so I feel pretty comfortable under the hood.