积极答复者
数据库压缩使用DBCC shrinkfile很慢,请问有啥好的解决办法吗?谢谢!

问题
答案
-
Hi Tim-2009,
感谢您的提问。
>>>数据库版本是2008+sp1,不压缩的话,只是没把磁盘空间释放给操作系统吧,数据库还是可以重复使用那些空间的吧?
不压缩的话,数据库是不能重复使用那些空间的,必须shrink后,才能重复使用。>>>数据库压缩使用DBCC shrinkfile很慢,请问有啥好的解决办法吗?谢谢
关于好的解决办法,可以参考下面的博客:
https://www.cnblogs.com/Joe-T/archive/2011/12/22/2298051.html>>>为什么DBCC shrinkfile很慢, 请参考下面的英文博客:
https://www.sqlskills.com/blogs/paul/why-lob-data-makes-shrink-run-slooooowly-t-sql-tuesday-006/Best Regards
Willson Yuan
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com- 已建议为答案 alexander fun 2018年6月19日 11:07
- 已标记为答案 Tim-2009 2018年6月21日 12:19
全部回复
-
Hi Tim-2009,
感谢您的提问。
>>>数据库版本是2008+sp1,不压缩的话,只是没把磁盘空间释放给操作系统吧,数据库还是可以重复使用那些空间的吧?
不压缩的话,数据库是不能重复使用那些空间的,必须shrink后,才能重复使用。>>>数据库压缩使用DBCC shrinkfile很慢,请问有啥好的解决办法吗?谢谢
关于好的解决办法,可以参考下面的博客:
https://www.cnblogs.com/Joe-T/archive/2011/12/22/2298051.html>>>为什么DBCC shrinkfile很慢, 请参考下面的英文博客:
https://www.sqlskills.com/blogs/paul/why-lob-data-makes-shrink-run-slooooowly-t-sql-tuesday-006/Best Regards
Willson Yuan
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com- 已建议为答案 alexander fun 2018年6月19日 11:07
- 已标记为答案 Tim-2009 2018年6月21日 12:19
-
Hi 怡红公子,
>>>不shrink file,当前数据库是可以使用这些剩余空间的。
谢谢您的指正,你说的是对的,可能我们的理解稍有不同。我的理解是,不压缩的话,数据库所占的空间在操作系统上显示只可能是增加,不会释放出空间给其它与应用程序,包括其它数据库。由于每个数据库有自己的独立空间,每个数据库只能够使用自己所占用的空间, 因此对于该数据库的空间,必须shrink后才能被其它应用程序和数据库所使用。Best Regards
Willson Yuan
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com