收缩数据库日志文件

时间:2022-07-03 21:43:21
--SQL语句的设置方式:
alter database [dbname] modify file(name=[dbname_log],maxsize=200)
USE [dbname]
GO
ALTER DATABASE [dbname] SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE [dbname] SET RECOVERY SIMPLE 
GO
USE [dbname]
GO
DBCC SHRINKFILE (N'[dbname_log]' , 0, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE [dbname] SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE [dbname] SET RECOVERY FULL 
GO