SQL 失败SQL查询磁盘空间不足

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8944611/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 14:05:14  来源:igfitidea点击:

Failure SQL query insufficient disk space

sqlsql-serverjoinviewtempdb

提问by JsonStatham

Msg 1101, Level 17, State 10, Line 12 Could not allocate a new page for database 'TEMPDB' because of insufficient disk space in filegroup 'DEFAULT'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

消息 1101,级别 17,状态 10,第 12 行无法为数据库 'TEMPDB' 分配新页,因为文件组 'DEFAULT' 中的磁盘空间不足。通过删除文件组中的对象、向文件组添加其他文件或为文件组中的现有文件设置自动增长来创建必要的空间。

What does this mean in plain English.

这在简单的英语中是什么意思。

回答by Jeff Moden

I've found that the normal cause of such explosive growth of TempDB is a query, either ad hoc or in a stored procedure, that has an unexpected many-to-many join in it that some refer to as an "Accidental Cross Join". Behind the scenes, it can create litterally billions of internal rows that end up living in "work" tables that live in TempDB.

我发现 TempDB 如此爆炸性增长的正常原因是一个查询,无论是临时的还是存储过程中的,其中有一个意想不到的多对多连接,有些人称之为“意外交叉连接” . 在幕后,它可以创建数十亿的内部行,这些行最终存在于 TempDB 中的“工作”表中。

The fix isn't to simply allocate more disk space. The fix is to find which query is the cause of the problem and fix it. Otherwise, you'll be stuck in a never ending cycle of having to restart SQL Server, etc, etc.

解决方法不是简单地分配更多磁盘空间。解决方法是找出哪个查询是问题的原因并修复它。否则,您将陷入必须重新启动 SQL Server 等的永无止境的循环中。

And, no... you don't have to check to see if TempDB is in the "SIMPLE" recovery mode because you can't set it to anything else. Try it and see.

而且,不……您不必检查 TempDB 是否处于“简单”恢复模式,因为您无法将其设置为其他任何内容。试试看。

回答by SQLMenace

It means your tempdb database filled up

这意味着您的 tempdb 数据库已满

you can

你可以

  1. Restart the SQL Server service, this will recreate the tempdb database
  2. Add another file on another disk with more space
  3. Shrink the log file of tempdb
  1. 重新启动 SQL Server 服务,这将重新创建 tempdb 数据库
  2. 在具有更多空间的另一个磁盘上添加另一个文件
  3. 收缩tempdb的日志文件

See Dealing with the could not allocate new page for database 'TEMPDB'. There are no more pages available in filegroup DEFAULT error messagefor more details

请参阅处理无法为数据库“TEMPDB”分配新页面的问题。文件组 DEFAULT 错误消息中没有更多可用页面以获取更多详细信息

回答by Mohammad Afaque Siddiqui

  1. Stop the Citrix System Monitoring Agent service
  2. Stop the Firebird Server - CSMInstance service
  3. Delete the RSDATR.FDB firebird database located at C:\Documents and Settings\All Users\Application Data\Citrix\System Monitoring\Data
  4. Restart the services
  1. 停止 Citrix 系统监控代理服务
  2. 停止 Firebird 服务器 - CSMInstance 服务
  3. 删除位于 C:\Documents and Settings\All Users\Application Data\Citrix\System Monitoring\Data 的 RSDATR.FDB firebird 数据库
  4. 重启服务