Upgrading an Enterprise GIS System: Geodatabase Schema Changes
Posted by Dave Bouwman | Posted in ArcGIS Devt, ArcSDE, ESRI | Posted on 23-11-2005
1
Problem:
We have a geodatabase which was originally modeled in UML, but the UML is out of synch with the geodatabase, and we don’t have the time to update the model to match the geodatabase. But, we need to add some new featureclasses to the geodatabase, and we want to design and document these using UML. How do we get the new items into the old geodatabase?
Option 1: Import XMI into the geodatabase
I’d hoped that this would work, but ArcCatalog simply crashed. After some head scratching (mostly because my other options seemed overly difficult), I seemed to have a vague recollection that you need to import models through a connection that attaches to the database as the SDE user. It seems that you can import a model as any user who has correct permissions, BUT, if you import a model which references a domain which already exists, then you need to be connected as SDE. If not, you’ll get another informative error:
Unable to aquire schema lock for {domain name}

I really wish ESRI put some better messaging into the CASE Tools – how hard would it be to pop a message reminding you to connect as SDE when starting the model import tool? And while I’m in this topic, the first time I tried to import my XMI file, I got this error:
Unable to load model from XML file {path}
An error occured while parsing the XML document.
Error number: 516

How useless is this? You can google this error, and get to this page at ESRI that tells you the problem – you need the uml.dtd file in the same folder as your xmi file. Now, since the code clearly knows what’s wrong (error 516) why not just tell me!
Anyhow, turns out that you can apply a partial model into an existing geodatabase, if you connect as SDE. Of course this causes the newly created featureclass to be owned by SDE, and not the user you want to own it. So – back to the drawing board and…
Option 2: Import XMI into a new geodatabase, Export the featureclasses to XML schema, and import that into target geodatabase
This time, I created a new database in my SQL instance, set it up for SDE, and imported the model into it as SDE. Then exported an XML workspace document. And then attached to my target geodatabase as the ‘owner’, and imported the XML Workspace document. And it worked. In order to make sure I did not mess anything up, I had been working on a copy of the real geodatabase, so the real test was to try the same thing on the real one. It worked. Really. So, it appears that the XML schema stuff is the way to go. Hopefully ESRI will create a geodatabase designer which spits out this XML because it would be a whole lot better than messing with XMI/Visio/UML kludge.
Now this this is sorted out, I now have to figure out how to massage the existing data which is going to populate one of the 3 subytpes in one of the new feature classes. But that can wait for a few days.


Have you had a look at Richie’s "Geodatabase Designer" tool on ArcScripts at http://arcscripts.esri.com/details.asp?dbid=13484. It might help with some things…
- Thomas