--1.先查询数据的日志文件的名称
USE lwlz_zhiluo
GO
SELECT name FROM SYS.database_files WHERE type_desc='LOG' --2.执行清空日志文件
USE [master]
GO
ALTER DATABASE lwlz_zhiluo SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE lwlz_zhiluo SET RECOVERY SIMPLE --简单模式
GO
USE lwlz_zhiluo
GO
DBCC SHRINKFILE (N'ChainStock_Public_log' , 0,TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE lwlz_zhiluo SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE lwlz_zhiluo SET RECOVERY FULL
GO --3.还原成完全模式
ALTER DATABASE lwlz_zhiluo SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE lwlz_zhiluo SET RECOVERY FULL --还原为完全模式
GO
lwlz_zhiluo是数据库的名字
ChainStock_Public_log是日志文件的名称