Tag: SQL Server database log shrinks free space.
How SQL Server database shrinks log space
Description: SQL Server database log will become larger, especially when the space is tight, you have to shrink the log to release some of the space, the following means.
Version: SQL Server R2
Method:
-
new query, execute script. The script is as follows
Note that the Red section needs to be modified to the appropriate database name. The green section needs to be modified to the corresponding database log name
Use [ usrinf ]
GO
ALTER DATABASE usrinf SET RECOVERY simple with no_wait
GO
ALTER DATABASE usrinf SET RECOVERY simple
GO
use usrinf
GO
DBCC shrinkfile (N ' usrinf_log ', 0,truncateonly)
GO
Use [usrinf ]
GO
ALTER DATABASE usrinf SET RECOVERY full with no_wait
GO
ALTER DATABASE usrinf SET RECOVERY full
GO
-
Modify the recovery model for the corresponding database to a simple mode . such log files can grow very slowly.
Right------options on the database-----Recovery Mode-----Simple
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7A/6A/wKiom1aohfuBWbaqAAEGqGY2bwM720.jpg "title=" 96a65e25-7f49-4f09-9f82-03ca6e1b186a.jpg "alt=" Wkiom1aohfubwbaqaaegqgy2bwm720.jpg "/>
This article is from the "Technical Achievement Dream" blog, please be sure to keep this source http://pizibaidu.blog.51cto.com/1361909/1739290
How does SQL Server database shrink log space?