释放 SQL Server 中的空间

发布于 2024-11-10 04:52:41 字数 322 浏览 0 评论 0原文

我想知道是否有人能指出我正确的方向。

我在 SQL Server 数据库中有许多表,并且使用脚本来分析每个表所使用的空间。

如果有人感兴趣,可以在这里找到该脚本: http://www.sqlteam.com /forums/topic.asp?TOPIC_ID=61762

我的表大小只占数据库大小的三分之一左右,所以我的问题是什么在使用其余空间以及如何减少数据库的总体大小?

非常感谢您的指点。

I wonder if anyone can point me in the right direction with this please.

I have a number of tables in a SQL Server database and I have used a script to analyze the space that's being used by each table.

The script can be found here if anyone's interested: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61762

My table sizes only account for about a third of the size of the database, so my question is what is using the rest of space and how can I reduce the overall database size?

Many thanks for any pointers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独﹏钓一江月 2024-11-17 04:52:41

您是否因为遇到磁盘空间问题而需要回收空间?如果没有,就离开吧。

几乎可以肯定,收缩数据库和/或文件会导致问题:

引用上一篇:

Myth #9: Data file shrink does not affect performance.

Hahahahahahahahahahahahahahaha! <snort>

<wipes tears from eyes, attempts to focus on laptop screen, cleans drool from keyboard> 

通常,如果数据库基于以前的auotgrows的大小,则数据库需要是这个大小。

例如,重建索引时,您需要大约 1.2 倍于最大表的可用空间。如果一张表占您数据的 25%,那么该表在索引重建期间将消耗 55%。

所以,除非您有迫切需要,否则不要这样做......

Do you need to reclaim space because you have disk space problems? If not, leave it.

You are almost certain to cause issues by shrinking database and/or files:

Quoting from the last one:

Myth #9: Data file shrink does not affect performance.

Hahahahahahahahahahahahahahaha! <snort>

<wipes tears from eyes, attempts to focus on laptop screen, cleans drool from keyboard> 

Generally the database needs to be this size if it is this size based on previous auotgrows.

For example, you need free space of approximately 1.2 times your biggest table when indexes are being rebuilt. If one table is 25% of your data then this table consumes 55% during index rebuilds.

So, don't do it unless you have a severe need...

瑶笙 2024-11-17 04:52:41

假设这是 SQL Server 特定的,

DBCC SHRINKDATABASE

http ://msdn.microsoft.com/en-us/library/aa258287%28v=sql.80%29.aspx

Assuming that this is SQL Server specific,

DBCC SHRINKDATABASE

http://msdn.microsoft.com/en-us/library/aa258287%28v=sql.80%29.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文