2

I want to know if there is any way I can query the RDBMS to determine whether it is an ArcSDE Geodatabase, or if I have to do it through ArcObjects. I am wondering if it would be enough to check if the SDE schema exists on the target database, and then maybe check if the SDE.VERSION table also exists and then conclude that it's an ArcSDE Geodatabase.

The ArcSDE Geodatabases are Oracle, and I use ArcObjects SDK 10 .NET in C#.

  • 1
    I'm not proposing this previous question as a duplicate but I think it has some elements in common with your question and so may be worth you reviewing – PolyGeo Jul 16 '13 at 11:29
  • @PolyGeo I didn't make it clear in my question that I use Oracle and the .NET SDK, so naturally I would like a solution on either of these "platforms". I am writing RDBMS because if i went through ArcObjects what the underlying database type is wouldn't matter. But in cases where I had to query the RDBMS directly, i would prefer an Oracle query. – furier Jul 16 '13 at 12:33
3

ArcGIS 10.0 can connect directly to a database. Although, the connection properties that you provide to the SdeWorksapceFactory are slightly different. You could just try to connect to the database as a geodatabase. You should get an error if it isn't a geodatabase. If you have a workspace reference already, you can test the workspace to see if it is an ISqlWorkspace (database) or an IVersionedWorkspace (geodatabase).

if (myWorkspace is IVersionedWorkspace)
{
     //geodatabase
}
else if (myWorkspace is ISqlWorkspace)
{
     //database
}
else 
{
     //something else like shapefile, personal or file gdb...
}

At 10.1, the connection properties are the same, so it is a little simpler. All you have to do then is connect to the database/geodatabase and query the workspace properties.

You could check for the sde schema (and posibly the dbo schema on SQLServer), and then check for the SDE.Version (or dbo.SDE_Version) table. That will tell if there is a geodatabase. Obviously this is fairly rudimentary, and only tells you if you have a geodatabase. Nothing about your ability to connect to it. For example, the geodatabase may not be accepting connections, or it may be corrupt.

|improve this answer|||||
  • 2
    good points in the end there, I also got a tip about checking the table SDE.SERVER_CONFIG where a status attribute is either 1 = ok || 2 = gdb is paused or inactive. – furier Jul 17 '13 at 5:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.