locked
Where\what process is deleting the transaction replication snapshot files RRS feed

  • Question

  • Greetings having an issue with the snapshot files being deleted quickly, seems that they are being removed from the snapshot folder quickly and trying to determine what process does that? I thought it was the distribution clean up agent job? I checked the settings and they appear to be the same in the environment I am losing them in, as in other environments where they are not removed as quickly. Thanks
    Thursday, March 12, 2020 9:02 PM

All replies

  • Hello Abeljdang,

    First, could you share the configuration of distribution cleanup agent job? I'm not sure if you setting some wrong value. Or you can try to stop this job, then check if the snapshot file been deleted quickly. 

    Except distribution cleanup agent job, SQL Server uses the retention setting to determine how long the snapshot exists, after the maximum retention time has expired the snapshot is of no use anymore and can be deleted.  More detail about retention setting, you can refer to Stairway to SQL Server Replication: Level 4 - Transactional Replication – The Subscriber You can check if the maximum retention time is to short:

    Meanwhile, you also can start replication monitor to if deleting snapshot file is logged, and please share this log information to me. Here you can follow to start replication monitor:  View information and perform tasks using Replication Monitor

    Hope it will help. If this issue persists, any new feedback will help to resolve this issue.

    Best Regards 

    Dawn Yang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, March 13, 2020 2:38 AM
  • Hello thanks for the reply. My distribution database properties are the same as what you show in your screen shot, 0, 72, 48. I checked the agent job created but it does not by default create a log file. I will set one up, disable the job, run some snapshots and do further research. I thought there might be somewhere else this is being done. Also another interesting item here, there are 2 subscriptions from 2 servers. 1 server all the files are being deleted, 1 which only subscribes to 1 publication, this subscribers files are not deleted on the same schedule.
    Friday, March 13, 2020 12:59 PM
  • It is the distribution clean up job that is deleting them. it defaults to 10 minutes and is removing all files 1st run after a snapshot except for the 1 subscription I mentioned above. 
    Friday, March 13, 2020 1:27 PM
  • Hello friend,

    I am so glad to hear that you figured out the cause for your issue. Could you please mark the useful reply as answer. This can be beneficial to other community members reading the thread.
    In addition, if you have another questions, please feel free to ask.
    Thanks for your contribution.

    Best Regards,

    Dawn Young


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 19, 2020 6:29 AM