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

后端 未结 6 825
孤街浪徒
孤街浪徒 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: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;
    

提交回复
热议问题