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>);
-- Reset the database recovery model.
ALTER DATABASE <database_name>
SET RECOVERY FULL;
GO

posted @ 2024-07-24 10:44  zhaoguanhao  阅读(2)  评论(0编辑  收藏  举报