SQL Server2008清空日志文件

  USE[master]
    GO
    ALTER DATABASE mydbname SET RECOVERY SIMPLE WITH NO_WAIT
    GO
    ALTER DATABASE mydbname SET RECOVERY SIMPLE   --简单模式
    GO
    USE mydbname 
    GO
    DBCC SHRINKFILE (N'mydbname_Log' , 11, TRUNCATEONLY)
    GO
    USE[master]
    GO

    ALTER DATABASE mydbname SET RECOVERY FULL WITH NO_WAIT

    GO

    ALTER DATABASE mydbname SET RECOVERY FULL  --还原为完全模式

    GO

 

posted @ 2016-07-07 01:10  coolsundy  阅读(223)  评论(0编辑  收藏  举报