none
The meaning of Retention Period in Change Tracking RRS feed

  • Question

  • Hi all,

    Probably it is a silly question but I'm really confused about the behavior. MSDN defines the retention period as: The change retention value specifies the time period for which change tracking information is kept. Change tracking information that is older than this time period is removed periodically.

    I'm running SQL Server 2008 with Change Tracking enabled. I set the Retention Period 7, Retention Period Units Days and Auto Cleaned up True.

    Let say today, 26th Oct is the cutoff day of the retention period. Hence according to that link, all the change tracking that is older than 7 days will be removed. In my understanding, it will keep any tracking information between 19th and 26th Oct only. Tomorrow, it will keep the ones within period 20th and 27th Oct.

    But I found different behavior. When syncing, I got an error indicated that change tracking has cleaned up tracking information, the local database (sdf) has to be reinitialized. I did last sync yesterday (it means no longer than 7 days) so I hope that error didn't occur.

    Could any of you explain me about these?

    - Is my understanding about the concept (Retention Period) correct?

    - Why did I get the error and how to avoid it?

    - Is there any way to check the creation time of the change tracking?

    Thanks,

    Agung

     

     

    Tuesday, October 26, 2010 3:12 AM

Answers

  • you get the error if the last received anchor in your client is less than the lowest version in the change tracking metadata.

    you'll find this condition in the SelectIncremental SQL statements.

    Tuesday, October 26, 2010 3:52 AM
    Moderator

All replies

  • you get the error if the last received anchor in your client is less than the lowest version in the change tracking metadata.

    you'll find this condition in the SelectIncremental SQL statements.

    Tuesday, October 26, 2010 3:52 AM
    Moderator
  • you get the error if the last received anchor in your client is less than the lowest version in the change tracking metadata.

    you'll find this condition in the SelectIncremental SQL statements.


    Hi JuneT,

    Yes, there is a checking of CHANGE_TRACKING_MIN_VALID_VERSION against @sync_last_received_anchor on the statement. There was, however, no error before the cutoff day.

    As the last 7 days tracking information are kept, I thought my CHANGE_TRACKING_MIN_VALID_VERSION would be some value at the 19th Oct while @sync_last_received_anchor would be some value at 25th Oct (yesterday). Hence in my view, the @sync_last_received_anchor would be greater than CHANGE_TRACKING_MIN_VALID_VERSION. In this case, the error should not happen.

    I'm wondering if the auto cleaned up reset everything so suddenly I get CHANGE_TRACKING_MIN_VALID_VERSION greater than @sync_last_received_anchor. If so, I can't see the advantage of the retention period as there is no tracking information kept when the cutoff day reached.

    Please help for clearer understanding about this feature.

    Thanks,

    Agung

     

     

    Tuesday, October 26, 2010 5:53 AM