减小日志文件
SQLSERVER2005
backup log qingpu with NO_LOG;
backup log qingpu with TRUNCATE_ONLY;
DBCC SHRINKDATABASE(qingpu) ;
SQLSERVER2008
USE [master]
GO
ALTER DATABASE qingpu SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE qingpu SET RECOVERY SIMPLE --简单模式
GO
USE qingpu
GO
DBCC SHRINKFILE (N'qingpu_Log' , 11, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE qingpu SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE qingpu SET RECOVERY FULL --还原为完全模式
GO
SQL SERVER 2014
USE [master]
GO
ALTER DATABASE PDSZ SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE PDSZ SET RECOVERY SIMPLE
GO
USE PDSZ
GO
DBCC SHRINKFILE (N'PDSZ_Log' , 11, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE PDSZ SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE PDSZ SET RECOVERY FULL
GO
如果有系统日志,执行
EXEC sp_cycle_errorlog,有几个日志文件执行几次。