大型 SQL Server 2000 数据库
我有一个大型 SQL Server 数据库 (1 TB),但没有更多空间,我应该首先使用什么来尝试减小数据库的大小?删除表需要时间,收缩也需要时间?是否有一个在后台运行的程序有助于减小数据库大小?
I have a large SQL Server database (1 TB) and I do not have more space, what should I use first to try to decrease the size of the database? Deleting tables will take time, shrink also it will take time? Is there a procedure that would run in the background that helps in decreasing the database size?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,没有任何流程可以立即减少大小 - 如果有的话,我想 SQL 团队会自动将其到位。
如果删除记录,通常只能减小数据库大小。之后您必须收缩数据库。
我发现一种不太耗时的方法是截断或删除表,但显然这并不总是可行!
No, there is no process you can run that takes no time to decrease the size - if there was I would imagine the SQL team would have it in place automatically.
You can only generally decrease the database size if you delete records. After that you have to shrink the database.
I've found one of the less time-consuming ways is to truncate or drop tables, but obviously this is not always possible!
在不花费任何时间的情况下减少大小的唯一方法是删除数据库......除此之外,这是一个非常广泛的问题。
我认为执行此操作的最佳方法是首先备份数据,然后开始删除可能不需要的旧数据。
我想说你的主要问题不是你需要缩小数据库,而是你需要制定维护和增长计划,如果你只是压缩现在拥有的数据,你将来会再次遇到同样的情况。重新索引也不会真正帮助这种情况。
我会尝试花一些时间并正确执行此操作,您想要(如果可能)备份和导出旧数据,当不再需要时将其从数据库中删除,或者如果不可能增加数据库的大小,因为它似乎已经超越了你最初的设计。
也可能建立一个系统,让您或其他人监视数据库及其大小,它不应该出现您说数据库完全满并且您必须快速实施解决方案的情况。
The only way to reduce the size without taking any time is
DROP DATABASE
.... Other than that this is a really broad question.The best way I can think to do this would be to first backup the data then start deleting old data which may not be needed.
I would say your main problem isnt that you need to shrink the database its that you need to put in a plan for maintainance and growth, if you just compress the data you have now you will end up in this same situation again in the future. Re-Indexing wont really help this situation either.
I would try take some time and do this properly, you want to (if possible) backup and export old data, removing it from your database when it is no longer needed, or if this is not possible increase the size of your database as it seems to have grown past your initial designs.
Also maybe put in place a system where you or someone else monitors the database and its size, it shouldn't get to a situation where you say the database is completely full and you have to implement a solution quickly.