Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

I have a Sybase SQL Anywhere 11.0.1 database that I am using to sync with an Oracle Consolidated Database.

I believe that the SQL Anywhere database keeps track of all of the changes that are made to it so that it knows what to synchronize with the consolidated database. My question is whether or not there is a SQL command that will tell you if the database has been changed since the last sync.

asked 08 Dec '09, 17:43

runxc1's gravatar image

runxc1
31112
accept rate: 0%

edited 15 Mar '13, 18:47

Mark%20Culp's gravatar image

Mark Culp
24.9k10141297


(Note: This is an answer primarily based on my personal memory - so please treat as untested and handle with care:))

AFAIK, there is no obvious SQL statement to tell you whether a sync would upload any changes.

However, there are two database properties that might help you find out whether there have been any changes in the database after the last sync. However, this does not tell you necessarily that these changes are relevant w.r.t. MobiLink (i.e. are related to published data):

select db_property('CurrentRedoPos'), db_property('SyncTrunc');

As to the docs:

CurrentRedoPos: Returns the current offset in the transaction log file where the next database operation is to be logged.

SyncTrunc: Returns the minimal confirmed log offset for the MobiLink client dbmlsync executable.

The idea is to compare both log offset values. If CurrentRedoPos > SyncTrunc then there might be something to upload.

However, it could be that CurrentRedoPos will always be higher than SyncTrunc as a successful (and confirmed) sync will lead to updated system information, and that might result in a higher current offset by itself. In other words, after a successful and confirmed Sync, the database will adjust the SyncTrunc value (which is stored in sys.syssyncs, AFAIK), and that alone will increase the CurrentRedoPos value.

So this approach might give an idea but not much more...

permanent link

answered 09 Dec '09, 07:59

Volker%20Barth's gravatar image

Volker Barth
40.2k361550822
accept rate: 34%

edited 09 Dec '09, 08:14

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×371
×84
×30

question asked: 08 Dec '09, 17:43

question was seen: 3,091 times

last updated: 15 Mar '13, 18:47