SQL Server 2005,缩小复制数据库

时间:2021-06-18 10:07:07

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

现在我正在使用具有可更新订阅的事务复制。是否有任何方法(包括T-SQL)可用于缩小复制模式中使用的分发数据库?该文件名为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

另外我发现文件夹repldata上存储了相当大的数据,是否保存删除这些文件?如何?或者至少有些人如何缩小它

Thanks

1 个解决方案

#1


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.

分发数据库只是一个常规系统数据库,所以是的,您可以像对待所有其他数据库(它位于System Databases文件夹下)(例如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)

repldata应该包含复制的快照,并且是新订阅和以前的订阅重新初始化所必需的。除非您使用Snapshot发布,否则我相信您可以安全地删除内容。但是我没有找到任何确认它受支持的文档,因此它可能不是一个好主意(但是,由于SQL Server 2000和更新版支持快照的备用位置,包括可移动媒体,它不应该关心它)

#1


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.

分发数据库只是一个常规系统数据库,所以是的,您可以像对待所有其他数据库(它位于System Databases文件夹下)(例如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)

repldata应该包含复制的快照,并且是新订阅和以前的订阅重新初始化所必需的。除非您使用Snapshot发布,否则我相信您可以安全地删除内容。但是我没有找到任何确认它受支持的文档,因此它可能不是一个好主意(但是,由于SQL Server 2000和更新版支持快照的备用位置,包括可移动媒体,它不应该关心它)