删除sqlserver数据库的日志
程序员文章站
2022-06-13 08:37:47
...
sql server 2008 以前的版本
--DUMP TRAN db_name WITH NO_LOG;
--BACKUP LOG db_name WITH NO_LOG;
sql server 2012
USE [master]
ALTER DATABASE db_name SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE db_name SET RECOVERY SIMPLE --简单模式
GO
USE db_name
GO
DBCC SHRINKFILE (N'db_name _Log' , 11, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE db_name SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE db_name SET RECOVERY FULL --还原为完全模式
GO