sqlserver 清理收缩日志

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_log_name>);
GO

-- Reset the database recovery model.
ALTER DATABASE <database_name>
SET RECOVERY FULL;
GO

posted @ 2024-07-24 10:45  zhaoguanhao  阅读(14)  评论(0)    收藏  举报