on 2009 Dec 08 5:43 PM
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.
Request clarification before answering.
(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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.