“The transaction log for database is full due to 'LOG_BACKUP'” in a shared host

后端 未结 6 805
孤街浪徒
孤街浪徒 2021-01-30 09:50

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 pane

相关标签:
6条回答
  • 2021-01-30 10:21

    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.

    0 讨论(0)
  • 2021-01-30 10:29

    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

    0 讨论(0)
  • 2021-01-30 10:32

    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.

    0 讨论(0)
  • 2021-01-30 10:40

    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 :)

    0 讨论(0)
  • 2021-01-30 10:41

    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.

    After chaning to unlimited, database came back to life.

    0 讨论(0)
  • 2021-01-30 10:44

    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;
    
    0 讨论(0)
提交回复
热议问题