2018年6月28日 星期四

【SQL】The transaction log for database is full due to 'LOG_BACKUP'

交易紀錄滿了的處理

清紀錄
 -- Truncate the log by changing the database recovery model to SIMPLE.  
ALTER DATABASE MyDB
SET RECOVERY SIMPLE;  
GO  
-- Shrink the truncated log file to 1 MB.  
DBCC SHRINKFILE (MyDB_log, 1);  
GO  
-- Reset the database recovery model.  
ALTER DATABASE MyDB
SET RECOVERY FULL;  
GO 
-- select name from sys.database_files; 查 log file name(沒改名的話一般都是 dbName_log) 

ref: SO
擴充等其他應對:MSDN

沒有留言:

張貼留言