Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 994 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"The transaction log for database is full due to 'LOG_BACKUP'" in a shared host

#1
I have an Asp.Net MVC 5 website with EntityFramework codefirst approach in a shared hosting plan. It uses the open source [WebbsitePanel](

[To see links please register here]

) 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](

[To see links please register here]

) and [this](

[To see links please register here]

) or [this](

[To see links please register here]

) 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;");

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?

Reply

#2
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.
Reply

#3
I got the same error but from a backend job (SSIS job). Upon checking the database's Log file growth setting, the log file was limited growth of 1GB. So what happened is when the job ran and it asked SQL server to allocate more log space, but the growth limit of the log declined caused the job to failed. I modified the log growth and set it to grow by 50MB and Unlimited Growth and the error went away.
Reply

#4
This error occurs because the transaction log becomes full due to LOG_BACKUP. Therefore, you can’t perform any action on this database, and In this case, the SQL Server Database Engine will raise a 9002 error.

To solve this issue you should do the following

- Take a Full database backup.
- Shrink the log file to reduce the physical file size.
- Create a LOG_BACKUP.
- Create a LOG_BACKUP Maintenance Plan to take backup logs frequently.

I wrote an article with all details regarding this error and how to solve it at [The transaction log for database ‘SharePoint_Config’ is full due to LOG_BACKUP][1]



[1]:

[To see links please register here]

Reply

#5
In Addition to Ben's Answer, You can try Below Queries as per your need

USE {database-name};
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE {database-name}
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE ({database-file-name}, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE {database-name}
SET RECOVERY FULL;
GO

**Update** Credit **@cema-sp**

To find database file names use below query

select * from sys.database_files;
Reply

#6
Occasionally when a disk runs out of space, the message "transaction log for database XXXXXXXXXX is full due to 'LOG_BACKUP'" will be returned when an update SQL statement fails.
Check your diskspace :)
Reply

#7
This can also happen when the log file is restricted in size.

Right click database in Object Explorer

Select Properties

Select Files

On the log line, click the ellipsis in the Autogrowth / Maxsize column

Change/verify Maximum File Size is Unlimited.

[![enter image description here][1]][1]


[1]:


After chaning to unlimited, database came back to life.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through