views:

289

answers:

1

Right now i currently using transactional replication with updatable subscription. Is there any ways (including T-SQL) that can use to shrink down distribution database used within replication schema? The file was named distribution.MDF

Also i found quite large data stored on folder repldata, is it save to delete this files? And how? Or at least some me how to shrink it

Thanks

+1  A: 

The distribution database is just a regular system database, so yes, you can shrink it the same way as you do with all the other databases (It is located under the System Databases folder) in for instance the Management Studio.

However, since that database is being used to store the data needed for the replication, it might grow again when more data is put in, so shrinking it might not always be recommended.

repldata should contain the snapshots for the replication and is needed for new subscriptions and re-initialization of previous ones. Unless you're using Snapshot publishing I believe that it is safe for you to remove the content. I have however not found any documentation that confirms that it is supported so it might not be a good idea to do it (however, since SQL Server 2000 and newer supports alternate locations of the snapshots, which include removable media it should not care about it)

Jimmy Stenke
thanks, right now i was use transactional replication with updatable subscription, so it's save to remove the repldata?
Dels
I have never tried it myself, nor have I found any documentation about it, so I can't really recommend it. But I think it would be safe.However, you should probably not do that, instead, move it to another place. The snapshot folder doesn't have to be on the database machine, so if you have space somewhere else on the network, move it there. Have a look at "sp_browsesnapshotfolder", "sp_copysnapshot" and "sp_changepublication" in the Books Online.
Jimmy Stenke