Can't delete raster FC from gdb

2026
2
07-29-2013 05:52 AM
QuinnMcCarthy
New Contributor
I have a raster FC in a SQL server based GDB that I can't delete. It haust be corrupt because it says that the raster data set is not valid and I cannot delete the raster.

What is the best way to do that?

thanks

Quinn
0 Kudos
2 Replies
VinceAngelo
Esri Esteemed Contributor
Copy the valid data out of the FGDB, then delete the original directory.

- V

[Doh!  I saw "GDB" and somehow came up with "FGDB".  It's rare that you can mess
up an ArcSDE raster so badly that ArcGIS won't read it.  Jake's instructions below
should delete it completely, but you can also try the halfway solution of just removing
the GDB_ITEMS entry and trying to re-register it with the geodatabase.  Coordination
with Tech Support on this sort of failure is generally a good idea, mostly because this
sort of error is so rare, Esri ought to know about it.  BTW, the supported way to delete
a raster from a database is also to salvage what you can into a new database.]
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Hi Quinn,

What version of SDE are you using?  You may have to delete the raster dataset manually by executing some queries in SQL Server Management.  Before doing so, be sure to create a database backup.  Here are the queries that will remove the raster dataset from an SDE 10.x geodatabase:

select rastercolumn_id from sde.sde_raster_columns where table_name = '[table_name]' 

select layer_id from sde.sde_layers where table_name = '[table_name]' 

--Recall the two numbers from these queries. Then run the following queries:


delete from sde.GDB_ITEMS where Name = '<datbase>.<owner>.[table_name]' 

delete from sde.sde_table_registry where table_name = '[table_name]' 

delete from sde.sde_layers where table_name = '[table_name]' 

delete from sde.sde_raster_columns where table_name = '[table_name]' 

delete from sde.sde_geometry_columns where f_table_name = '[table_name]' 

DROP TABLE <owner>.[table_name]

DROP TABLE <owner>.sde_aux_<# from above rastercolumn_id query> 

DROP TABLE <owner>.sde_bnd_<#> 

DROP TABLE <owner>.sde_blk_<#> 

DROP TABLE <owner>.sde_ras_<#> 

DROP TABLE <owner>.f[number from above sde_layers query] 

DROP TABLE <owner>.s[number from above sde_layers query] 
0 Kudos