SqlServer数据库定时删除系统日志
时间:2018-12-23 23:53 来源:linux.it.net.cn 作者:IT
USE [master]
GO
ALTER DATABASE [ems_db] SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE [ems_db] SET RECOVERY SIMPLE
GO
USE [ems_db]
GO
DBCC SHRINKFILE (N'ems_db_log' , 0,TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE [ems_db] SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE [ems_db] SET RECOVERY FULL
GO
USE [ems_db]
GO
SELECT name FROM SYS.database_files WHERE type_desc='LOG'
ems_db是数据库的名称。
ems_db_log是日志名称。在属性_文件里
(责任编辑:IT)
USE [master]
GO
ALTER DATABASE [ems_db] SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE [ems_db] SET RECOVERY SIMPLE
GO
USE [ems_db]
GO
DBCC SHRINKFILE (N'ems_db_log' , 0,TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE [ems_db] SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE [ems_db] SET RECOVERY FULL
GO
USE [ems_db]
GO
SELECT name FROM SYS.database_files WHERE type_desc='LOG'
ems_db是数据库的名称。
(责任编辑:IT)ems_db_log是日志名称。在属性_文件里 |