sql server 2008清除日志

先改成简单模式,再清除日志,再改回原来模式

USE [oms20190322]
GO
ALTER DATABASE oms20190322 SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE oms20190322 SET RECOVERY SIMPLE
--简单模式
GO
USE oms20190322
GO
DBCC SHRINKFILE (N'nh_oms_log' , 11, TRUNCATEONLY)    --这里的名称需要到查询(SELECT file_id, name FROM sys.database_files;)逻辑名称
GO


USE oms20190322
GO
SELECT file_id, name FROM sys.database_files;
GO
USE [oms20190322]
GO
ALTER DATABASE oms20190322 SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE oms20190322 SET RECOVERY FULL
--还原为完全模式
GO

上一篇:Windows Server 2008 R2文件服务器升级到Windows Server 2016


下一篇:Microsoft SQL Server 2008 R2 Express and Management Studio Express