简体   繁体   English

通过将数据迁移到同一文件组中的其他文件来清空空文件的性能影响

[英]Performance Impact of Empty file by migrating the data to other files in the same filegroup

We have a database currently sitting on 15000 RPM drives that is simply a logging database and we want to move it to 10000 RPM drives. 我们现在有一个数据库,它位于15000 RPM驱动器上,它只是一个日志记录数据库,我们希望将其移动到10000 RPM驱动器。 While we can easily detach the database, move the files and reattach, that would cause a minor outage that we're trying to avoid. 虽然我们可以轻松分离数据库,移动文件并重新附加,这将导致我们试图避免的轻微中断。

So we're considering using DBCC ShrinkFile with EMPTYFILE . 所以我们正在考虑将DBCC ShrinkFile with EMPTYFILE We'll create a data and a transaction file on the 10000 RPM drive slightly larger than the existing files on the 15000 RPM drive and then execute the DBCC ShrinkFile with EMPTYFILE to migrate the data. 我们将在10000 RPM驱动器上创建一个比15000 RPM驱动器上的现有文件略大的数据和事务文件,然后DBCC ShrinkFile with EMPTYFILE执行DBCC ShrinkFile with EMPTYFILE以迁移数据。

What kind of impact will that have? 会产生什么样的影响?

I've tried this and had mixed luck. 我试过这个并且好运。 I've had instances where the file couldn't be emptied because it was the primary file in the primary filegroup, but I've also had instances where it's worked completely fine. 我有一些文件无法清空的实例,因为它是主文件组中的主文件,但我也有过完全正常工作的实例。

It does hold huge locks in the database while it's working, though. 但它确实在数据库中存在巨大的锁定。 If you're trying to do it on a live production system that's got end user queries running, forget it. 如果您尝试在运行最终用户查询的实时生产系统上执行此操作,请将其忘记。 They're going to have problems because it'll take a while. 他们会遇到问题,因为这需要一段时间。

Why not using log shipping. 为什么不使用日志传送。 Create new database on 10.000 rpm disks. 在10.000 rpm磁盘上创建新数据库。 Setup log shipping from db on 15K RPM to DB on 10k RPM. 安装日志从15k RPM的db发送到10k RPM的DB。 When both DB's are insync stop log shipping and switch to the database on 15K RPM. 当两个DB都是insync停止日志传送并以15K RPM切换到数据库。

Is this a system connected to a SAN, or is it direct attached storage? 这是一个连接到SAN的系统,还是直接连接的存储? If its a SAN do a SAN side migration to the new raid group and the server won't ever know there was a change. 如果它的SAN进行SAN端迁移到新的raid组,服务器将永远不知道有变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM