“由于'LOG_BACKUP',数据库的事务日志已满"在共享主机中 [英] "The transaction log for database is full due to 'LOG_BACKUP'" in a shared host

查看:1019
本文介绍了“由于'LOG_BACKUP',数据库的事务日志已满"在共享主机中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在共享托管计划中有一个使用EntityFramework codefirst方法的Asp.Net MVC 5网站.它使用开放源 WebbsitePanel 作为控制面板,其SQL Server面板有所限制.今天,当我想编辑数据库时,遇到了此错误:

I have an Asp.Net MVC 5 website with EntityFramework codefirst approach in a shared hosting plan. It uses the open source WebbsitePanel for control panel and its SQL Server panel is somewhat limited. Today when I wanted to edit the database, I encountered this error:

The transaction log for database 'db_name' is full due to 'LOG_BACKUP'

我四处搜寻,发现了许多相关的答案,例如,但问题在于它们建议运行对数据库的查询.我尝试运行

I searched around and found a lot of related answers like this and this or this but the problem is they suggest running a query on the database. I tried running

db.Database.ExecuteSqlCommand("ALTER DATABASE db_name SET RECOVERY SIMPLE;");

使用Visual Studio(在HomeController上),但出现以下错误:

with the visual studio (on the HomeController) but I get the following error:

System.Data.SqlClient.SqlException: ALTER DATABASE statement not allowed within multi-statement transaction.

我该如何解决我的问题?我应该联系支持团队(对我的房东来说有点差)还是可以自己解决这个问题?

How can I solve my problem? Should I contact the support team (which is a little poor for my host) or can I solve this myself?

推荐答案

致电您的托管公司,让他们设置常规日志备份或将恢复模型设置为simple.我敢肯定,您知道是什么因素决定了这一选择,但是无论如何我还是会明确的.如果需要恢复到任意时间点的能力,请将恢复模型设置为完全.不管哪种方式,数据库都是按原样配置的.

Call your hosting company and either have them set up regular log backups or set the recovery model to simple. I'm sure you know what informs the choice, but I'll be explicit anyway. Set the recovery model to full if you need the ability to restore to an arbitrary point in time. Either way the database is misconfigured as is.

这篇关于“由于'LOG_BACKUP',数据库的事务日志已满"在共享主机中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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