2018年6月28日 星期四

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

交易紀錄滿了的處理

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

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

沒有留言:

張貼留言