SQL Server 2008 缩小数据库日志

由于对数据的处理非常频繁,数据库日志非常大,要对日志进行缩减,可以用如下SQL语句。

USE BJZLS_OA;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE BJZLS_OA
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (BJZLS_OA_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE BJZLS_OA
SET RECOVERY FULL;
GO

 

posted @ 2013-08-07 10:05  飘落的枫叶  阅读(221)  评论(0)    收藏  举报