Recently the customer reflected a problem, saying that the application server failed to write the database, the first thought is the application server problem, and later from the feedback database running log, because the database is full of things log, resulting in no longer write data.
The following conclusions are drawn from this problem:
1, the database data files and things log files do not automatically expand by percentage, but should be increased by MB. Like every time you grow 100MB~200MB
2, to regularly clean up the database of things log files
3, in the event of database related problems, should be the first time to check the database running log
Here's how SQL Server 2008 cleans up the things log, and it's recommended to make it a timed job without having to intervene manually every time.
Use [master]
GO
ALTER DATABASE [databasename] SET RECOVERY simple with no_wait
GO
ALTER DATABASE [databasename] SET RECOVERY Simple
GO
Use [DatabaseName]
GO
DBCC shrinkfile (N ' Databasename_log ', 10,truncateonly)
GO
Use [master]
Go
ALTER DATABASE [databasename] SET RECOVERY full with no_wait
GO
ALTER DATABASE [databasename] SET RECOVERY full
GO
SQL Server2008 Cleanup log method. sql