首页 > 代码库 > 测试用的数据库Transaction Log太大, 用于缩减它的脚本

测试用的数据库Transaction Log太大, 用于缩减它的脚本

记在这里, 备用.

select name, recovery_model_descfrom sys.databaseswhere name = ‘WSS_Content_1000‘USE WSS_Content_1000 ;ALTER DATABASE WSS_Content_1000 SET RECOVERY Simple;gouse WSS_Content_1000gocheckpointgocheckpointgodbcc shrinkfile(WSS_Content_1000_Log, 200);goUSE WSS_Content_1000 ;ALTER DATABASE WSS_Content_1000 SET RECOVERY FULL;go

 

参考资料

===============

View or Change the Recovery Model of a Database (SQL Server)

http://msdn.microsoft.com/en-us/library/ms189272.aspx

How do you clear the SQL Server transaction log?

http://stackoverflow.com/questions/56628/how-do-you-clear-the-sql-server-transaction-log