sql server 2012日志清理
时间:2018-12-23 23:54 来源:linux.it.net.cn 作者:IT
USE [master]
GO
ALTER DATABASE dbName SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE dbName SET RECOVERY SIMPLE --简单模式
GO
USE jxt_db_new
GO
DBCC SHRINKFILE (N'dbName_Log' , 11, TRUNCATEONLY)
GO
--'这里的DNName_Log 如果不知道在sys.database_files里是什么名字的话,可以用以下注释的语句进行查询
USE dbName
GO
SELECT file_id,name from sys.database_files;
GO
USE [master]
GO
ALTER DATABASE dbName SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE dbName SET RECOVERY FULL --还原为完全模式
GO
(责任编辑:IT)
USE [master] GO ALTER DATABASE dbName SET RECOVERY SIMPLE WITH NO_WAIT GO ALTER DATABASE dbName SET RECOVERY SIMPLE --简单模式 GO USE jxt_db_new GO DBCC SHRINKFILE (N'dbName_Log' , 11, TRUNCATEONLY) GO --'这里的DNName_Log 如果不知道在sys.database_files里是什么名字的话,可以用以下注释的语句进行查询 USE dbName GO SELECT file_id,name from sys.database_files; GO USE [master] GO ALTER DATABASE dbName SET RECOVERY FULL WITH NO_WAIT GO ALTER DATABASE dbName SET RECOVERY FULL --还原为完全模式 GO (责任编辑:IT) |