This article brings you relevant knowledge about SQL server. There is a problem with the SQL Server database. If you limit the size of its log file, then when the database log reaches this size time, the database will stop writing logs. The following introduces the relevant information about SqlServer's task of creating automatic shrinking transaction logs. I hope it will be helpful to everyone.
Recommended study: "SQL Tutorial"
--将数据库设为简单模式。日志文件自动断开。 alter database dev_ecology set recovery simple; --查看日志文件状况 use dev_ecology; dbcc shrinkfile('dev_ecology_log') ; --恢复数据库模式 alter database dev_ecology set recovery full;
dev_ecology to your own The database name of
shrink_file is generally
xxx_log. If you are not sure, you can use the
select * from sys.database_files; statement to query the log file name.
Strongly recommended to be executed during the idle phase of the business)
Recommended study: "SQL Tutorial"
The above is the detailed content of Detailed graphic explanation of SqlServer's creation of automatic shrinking transaction log tasks. For more information, please follow other related articles on the PHP Chinese website!