SQL2008清除数据库日志脚本

时间:2021-08-18 15:11:09

--数据库名称sjjhzx,日志文件名称ksoa_zuizhong_Log'

USE sjjhzx   
GO   
ALTER DATABASE sjjhzx SET RECOVERY SIMPLE WITH NO_WAIT   
GO   
ALTER DATABASE sjjhzx SET RECOVERY SIMPLE      
GO   
USE sjjhzx    
GO   
DBCC SHRINKFILE (N'ksoa_zuizhong_Log' , 11, TRUNCATEONLY)   
GO   
USE sjjhzx
GO
ALTER DATABASE sjjhzx SET RECOVERY FULL WITH NO_WAIT   
GO   
ALTER DATABASE sjjhzx SET RECOVERY FULL     
GO