Select to view content in your preferred language

Compress Error <Error>Layer not found [sde.DEFAULT]</Error>

893
3
06-07-2011 10:27 AM
DavidAlvarez
Emerging Contributor
Hi,

I am trying to compress an SDE database and I am getting the error below. I have admin privileges

<Error>ERROR 999999: Error executing function.</Error>
  <Error>Layer not found [sde.DEFAULT]</Error>
  <Error>Failed to execute (Compress).</Error>

Any Thought on how to solve the problem?

Specifications:
SQL server 2008
One Instance Multiple Geodatabases
Windows XP SP3
ArcGIS 10 SP: 2 (build 10.0.2.3200)
Using a Direct Connection.
3 Replies
JakeSkinner
Esri Esteemed Contributor
Does the error message reference a specific feature class?  I've seen this error before when the sde.sde_table_registry contains an orphaned record from a deleted feature class.

In SQL Server Management Studio, you can run the following query:

select table_name from sde.SDE_table_registry


This will show all feature classes within the SDE geodatabase (ignore entries that begin with 'GDB').  See if you can see if there are any orphaned entries.
0 Kudos
DavidAlvarez
Emerging Contributor
Jake,

I found a a few orphaned records. Can I delete them from the SDE_table_registry?
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Yes, but before doing so create a database backup.  It is highly recommended not to edit any repository tables within the database itself, but this is the only way I've seen to fix this issue.  Once you have created a database backup, you can execute the following queries to delete the records from the 'sde.sde_table_registry' and other tables the orphaned feature class may be:

select layer_id from sde.sde_layers where table_name = 'FC name'

select registration_id from sde.sde_table_registry where table_name = 'FC name'

--Apply the 2 above values to the necessary queries below

delete from sde.GDB_ITEMS where name = '<database>.<owner>.FC name'

drop table <owner>.f<layer_id>

drop table <owner>.s<layer_id>

delete from sde.sde_geometry_columns where f_table_name = 'FC name'

drop table <owner>.i<registration_id>

drop table <owner>.FC Name

delete from sde.sde_layers where table_name = 'FC name'

delete from sde.sde_table_registry where table_name = 'FC name'
0 Kudos