DBCC SHRINKFILE

您所在的位置:网站首页 考拉系统检测异常操作怎么解决 DBCC SHRINKFILE

DBCC SHRINKFILE

2023-01-18 00:20| 来源: 网络整理| 查看: 265

So you have a database that is 1750 GB full of which 700 MB is not allocated if I understand correctly. Then you can shrink the database at maximum 700 MB to 1749 GB (rounded). That is not particular meaningful.

You will have to add more disk. And if that is not an option, you will need to create some free space in the database. Here are a couple of options do this:

Purge data you can live without. Drop indexes that you really need. (It is not uncommon to find databases with redundant indexes). Compress tables or indexes. If you are on Enterprise Edition, replace the clustered index with a clustered columnstore, this can be a big compression gain.

Although, with only 700 MB free, the latter two options may not really be available to you. If you have a 200 GB table you want to compress down to 150 GB, you will need 150 GB of disk space available, since SQL Server builds a new index structure. It does not compress in place.

Once you have freed up space inside the database, you could start shrinking. Although the only reason you would do that is that you desperately need the disk space for something else. Because I suspect that you will continue to pour data into that database.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3