清理SQL Server日誌

2021-10-04 12:41:51 字數 421 閱讀 2132

use [master]

goalter database 目標資料庫 set recovery ****** with no_wait

goalter database 目標資料庫 set recovery ****** --簡單模式

gouse 目標資料庫

godbcc shrinkfile (n'目標日誌檔案邏輯名' , 2000, truncateonly) --設定壓縮後的日誌大小為2m,可以自行指定

gouse [master]

goalter database 目標資料庫 set recovery full with no_wait

goalter database 目標資料庫 set recovery full --還原為完全模式

go

SQL Server日誌過大,清理日誌

直接執行下面的 use master go alter database 資料庫 set recovery with no wait goalter database 資料庫 set recovery 簡單模式 gouse 資料庫 godbcc shrinkfile n 邏輯名 2000,trunc...

sqlserver清理日誌檔案

b 清理日誌檔案 b use master goalter database matchkraft 資料庫名 set recovery with no wait goalter database matchkraft 資料庫名 set recovery gouse matchkraft 資料庫名 g...

SQL Server 日誌檔案清理

資料庫在使用過程中會發現日誌檔案越來越大,有時甚至超過了資料庫資料本身,而這些日誌資訊一直都不會使用到,這時就可以直接將過大的資料庫日誌檔案刪除掉。刪除步驟如下 1 登入 sql sever management studio 中,選擇需要處理的資料庫,右鍵 任務 分離 2 分離完成後,進入資料庫檔...