发布时间:2021-04-10 20:59:45来源:本站阅读(974)
日志太大,可用以下语句删除
-- 查询日志文件名,用于下面删除
USE [ZhMainData]
GO
SELECT file_id, name FROM sys.database_files
/*删除指定数据库的日志文件*/
USE [master]
GO
ALTER DATABASE ZhMainData SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE ZhMainData SET RECOVERY SIMPLE
GO
USE [ZhMainData]
GO
DBCC SHRINKFILE (N'ZhMainData_log' , 11, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE ZhMainData SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE ZhMainData SET RECOVERY FULL
GO
ZhMainData 是我的数据库名称,ZhMainData_log 是该数据库对应的日志文件名称
关键字: SQL SERVER
9593
871
2010
1516
1613
1096
1687
2122
887
1024
9593
5996
5523
5116
4567
4274
3415
3336
3335
3269