Question

How to compare schema difference between to gdb and get a status report matching/nonmatching


How to compare schema difference between to gdb and get a status report matching/nonmatching

2 replies

Userlevel 2
Badge +10

Hi @pragathjobs​ great question! What you're looking to tackle here is outlined in our webinar called Strategies for Detecting and Handling Schema Drift

 

One simple way to do this would be to read your geodatabases using two separate Geodatabase Readers. Next, add a SchemaScanner to your workspace and connect it to your first Geodatabase Reader. Open up the parameters and set the Ignore Attributes Containing parameter to ^multi|^fme|^geodb. This will remove any unwanted additional attributes from our resulting schema.

 

Now we need to expose those attribute names by using a ListExploder, so add a ListExploder to your workspace and connect it to the SchemaScanner. Open the parameters and set List Attribute to attribute{}.

 

Once everything looks good, copy both the SchemaScanner and ListExploder and connect it to your other Geodatabase Reader. Now, all you need to do is add a ChangeDetector transformer and connect your Geodatabases to the Original and Revised port. In the ChangeDetector, choose name as the attribute you want to compare. When you run the workspace, FME will now tell us which attributes have been changed. Your workspace should look something like the screenshot below.

image 

Hope this helps!

Thank you for the reply danminneyatsafe

I have to create a model where i have to compare two feature types(one may be from esri gdb and other oracle db). Here if the incoming featuretype/esrigdb has additional feature class with no data i have to replace the oracle db with the new schema and if the incoming esri gdb has data it should be compared for schema change and if no schema change is there it should replace the existing oracle db data. if there is schema change user should be warned about schema change.

 

Reply