sql 2008固态硬盘秒清日志(8G日志)
在SQL2008中清除日志就必须在简单模式下进行,等清除动作完毕再调回到完全模式。
USE [master]
GO
ALTER DATABASE DBName SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE DBName SET RECOVERY SIMPLE --简单模式
GO
USE DBName
GO
DBCC SHRINKFILE (N'DBName_Log' , 11, TRUNCATEONLY)
GO
USE[master]
GO
ALTER DATABASE DBName SET RECOVERY FULL WITH NO_WAIT
GO
GO
ALTER DATABASE DBName SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE DBName SET RECOVERY SIMPLE --简单模式
GO
USE DBName
GO
DBCC SHRINKFILE (N'DBName_Log' , 11, TRUNCATEONLY)
GO
USE[master]
GO
ALTER DATABASE DBName SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE DBName SET RECOVERY FULL--还原为完全模式
GO
______________________________________
生活,要用圣人的胸怀面对,用科学的方法支配,
用皇帝的御膳养胃,用清洁的空气洗肺,
用小猪的感觉去睡,用太阳的热情灌水。
______________________________________