Replication:The transaction log for database 'tempdb' is full due to 'ACTIVE_TRANSACTION'

今天早上,Dev跟我说,执行query statement时出现一个error,detail info是:

“The transaction log for database 'tempdb' is full due to 'ACTIVE_TRANSACTION'”

错误信息提示:由于活动事务太长,使得 tempdb 的 transaction log file 空间用尽。

一般情况下,由于tempdb 的 Recovery Mode是 simple,日志文件会自动截断和重用,如果活动事务太长,或短时间内事务日志太多,导致事务日志不能及时截断和重用,会出现log file 空间不足的问题。检查tempdb的日志file的设置:最大值,自动增长和Disk 剩余可用空间,保证 tempdb的 log file 有足够的Disk空间。

如果不是日志File设置的问题,那可能是tempdb的数据文件(mdf 或ndf)空间不足。查看Sql server的ErrorLog,发现错误信息:

"Could not allocate space for object 'dbo.TempTable_xxxx' in database 'db_yyyy' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup."

解决方案:

为tempdb 增加 File 或增加现有file的最大值,建议将 tempdb 的 files 存放在不同的Disk上,并且 files 的数量接近于或等于 CPU 数量,这样能够减少 PageLatch 和 PageIOLatch 等待。

参考文档:

Sql Server Error Messages : The transaction log for database ‘tempdb’ is full due to ‘ACTIVE_TRANSACTION’

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

悦光阴

你的鼓励是我创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值