sql server 2008 自动收缩日志文件

1、设置作业

USE master

GO
ALTER DATABASE DataAnalysisDB_Business SET RECOVERY 
SIMPLE WITH NO_WAIT

GO
ALTER DATABASE DataAnalysisDB_Business SET RECOVERY 
SIMPLE
GO
USE DataAnalysisDB_Business 

GO
DBCC SHRINKFILE (DataAnalysisDB_Business_log , 1000, TRUNCATEONLY) 
GO

USE master

GO
ALTER DATABASE DataAnalysisDB_Business SET RECOVERY FULL 
WITH NO_WAIT
GO
ALTER DATABASE DataAnalysisDB_Business SET RECOVERY FULL 

GO

 

posted @ 2018-10-18 11:12  狼人666  阅读(730)  评论(0编辑  收藏  举报