sql2005,sql2008,sql2012清空日志语句

sql2005清空日志语句

Backup Log DbName WITH no_log
GO
DUMP TRANSACTION DbName WITH no_log
GO
USE DbName
DBCC SHRINKFILE (2)
GO

sql2008,sql2012清空日志语句

ALTER DATABASE DbName SET RECOVERY SIMPLE WITH NO_WAIT
ALTER DATABASE DbName SET RECOVERY SIMPLE 
DBCC SHRINKFILE (N'DbName_Log' , 11, TRUNCATEONLY)
ALTER DATABASE DbName SET RECOVERY FULL WITH NO_WAIT 
ALTER DATABASE DbName SET RECOVERY FULL 

 

posted @ 2015-06-12 15:47  拎壶充  阅读(2604)  评论(0编辑  收藏  举报