Friday, 2 August 2019

arcgis desktop - How to make ArcMap aware of the changes that are made in base table?




I am using ArcMap One-way replication tool to synchronize feature classes from Oracle to MS SQL Server (once a day), but replication only works for the versioned data with move edits to base option as unchecked and only edits or changes from that specific version are synchronized in MSSQL server.


The version of the feature class (Oracle's) in ArcMap is different from the base tables (the one that is shown in Oracle SQL developer), how can I make sure that the data in base table and the one that is shown in ArcMap are same? How can I make sure the edits or changes that are made in either of the version are reflected to the other? How to make ArcMap aware of the changes that are made in base table?



Answer



Based on information in comments, it appears that you have been editing the base tables using SQL. You should not make changes to the base tables directly using your RDBMS software. You should use only the versioned views when editing directly with SQL. For documentation on this see: http://desktop.arcgis.com/en/arcmap/10.3/manage-data/using-sql-with-gdbs/overview-edit-versioned-data-with-sql.htm (then there are implementation-specific pages for Oracle, MSSQL, etc in the contents at left).


NB: Note that this page says



Editing the base table directly circumvents this and could lead to orphaned records and data loss.



This means that your database is effectively corrupt. There is no easy way out of this situation.


I think you need to abandon your plan to get it working at all using this database.



I would suggest exporting all data and then creating a new geodatabase. Then import all data into the new geodatabase (using either ArcGIS tools, or versioned views with SQL, but NOT using SQL against base tables!).


Then learn about how to use versions and replicas correctly. In particular, familiarise yourself with the information in the page linked to above, and the database-specific pages linked to from the contents on that page. Ie, don't ever touch the base tables using SQL. If you need to do anything with the database directly, you MUST use only the versioned views.


Once you have all the pieces back in place, you can sync your replica from the version of your choice, and you can use reconcile and post to sync data between versions. See:
http://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/a-quick-tour-of-reconciling-a-version.htm


You can use the compress procedure to pull changes into the base tables and prune the state tree to whatever extent is possible (a full compress requires all replicas to be in sync and all versions to be posted and reconciled, among other criteria). This doesn’t affect what is in each version, but it will improve database performance if the state tree gets complicated.


Note that the "base tables" do NOT represent a "base version" or the built in 'DEFAULT' version. They are a very different things. Versions are internally managed by a complex arrangement of base tables, adds and deletes tables, state table and views that pull it all together. Attempting to access tables directly without going through these views is asking for trouble and making edits that way will put your database into an inconsistent an unreliable state. Which is why it's not working as you expect.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...