由于事务日志文件已满,无法删除记录 [英] Unable to delete records as the transaction log file is full

查看:418
本文介绍了由于事务日志文件已满,无法删除记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

My disk is running out of space and as a result I decided to free some space by deleting old data. I tried to delete 100,000 by 100,000 as there are 240 million records to be deleted. But I am unable to delete them at once and shrinking the database doesn't free much space. This is the error im getting at times.

The transaction log for database 'TEST_ARCHIVE' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases

How can I overcome this situation and delete all the old records? Please advice.

推荐答案

问题是DELETE查询本身试图写入日志,但是没有磁盘空间扩大日志...
您有3种选择:
1. 截断表 [
The problem is that the DELETE query itself try to write into the log, but there is no disk space to enlarge the log...
You have 3 options:
1. TRUNCATE TABLE[^] the table...It will remove ALL the records without log...
2. If you need to keep part of the records, than create a temp table and insert the records-to-save into it, than run TRUNCATE TABLE and copy back the saved records...
3. Change the recovery mode of you DB to simple and than delete the rows. After that change recovery mode back...


这篇关于由于事务日志文件已满,无法删除记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆