Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I would like to delete the initial snapshot after I setup transnational replication and everything is working fine.

When is it OK to the delete the snapshot that initializes a subscriber?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

SQL Server uses the retention setting to determine how long the snapshot is good. After the maximum retention time has expired the snapshot is of no use anymore and can be deleted. The default for this setting is 72 hours.

Check Level 4 of my replication stairway for details: http://www.sqlservercentral.com/articles/Stairway+Series/72322/

share|improve this answer
add comment

You dont have to manually cleanup the old/static snapshot files, the distribution cleanup agent will purge the old folders for you.

A bit of under the hood story of what and how snapshot files gets generated :

Basically, the snapshot agent creates snapshots for the subscribers to initialize. The snapshot folder will contain various types of files like -

  • .bcp => actual data files - either using native or character mode
  • .idx => Index creation statements
  • .sch => schema and table creation scripts
  • .dri => foreign and check constraints

These files are always kept in \\unc\folder with a timestamp value for the folder name. The folder name is the publication name.

So, everytime a snapshot is generated, a new timestamp value is used for the folder name and then the snapshot files are written to that folder.

Also, if you see that your distribution agent is not cleaning up the files, you can delete the older snapshot folders. But I would still troubleshoot - why distribution agent is not cleaning it up !!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.