先改成简单模式,再清除日志,再改回原来模式
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