HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Snapshot Replication Retention

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
snapshotretentionreplication

Problem

I've got Snapshot replication set up on my SQL Server 2008 production server, and I just noticed that there are snapshots ranging back to a year ago in the snapshot folder. How can I change the retention for these snapshots? Specifically I'd like it to retain snapshots for 5 days.

Here's a screenshot of the folder I'm looking at:

Solution

This is usually an issue where the permissions on xp_cmdshell have been modified for security reasons. You can also have this issue if the SQL Agent account does not have the required network permissions to delete data from your replication folder.

-
Verify xp_cmdshell is enabled and that the account executing it has proper permissions.

USE master
GO
EXEC sp_configure 'show advanced option', '1';
reconfigure;
GO
exec sp_configure 'xp_cmdshell';


Output should be:

name         minimum    maximum config_value run_value
xp_cmdshell  0          1       1            1

Code Snippets

USE master
GO
EXEC sp_configure 'show advanced option', '1';
reconfigure;
GO
exec sp_configure 'xp_cmdshell';
name         minimum    maximum config_value run_value
xp_cmdshell  0          1       1            1

Context

StackExchange Database Administrators Q#6098, answer score: 7

Revisions (0)

No revisions yet.