How do I decrease the size of my sql server log file?

前端 未结 6 871
梦谈多话
梦谈多话 2020-12-04 13:08

So I have been neglecting to do any backups of my fogbugz database, and now the fogbugz ldf file is over 2 and half gigs. Thats been built up over the six months we\'ve been

6条回答
  •  感情败类
    2020-12-04 14:02

    • Perform a full backup of your database. Don't skip this. Really.
    • Change the backup method of your database to "Simple"
    • Open a query window and enter "checkpoint" and execute
    • Perform another backup of the database
    • Change the backup method of your database back to "Full" (or whatever it was, if it wasn't already Simple)
    • Perform a final full backup of the database.
    • Run below queries one by one
      1. USE Database_Name
      2. select name,recovery_model_desc from sys.databases
      3. ALTER DATABASE Database_Name SET RECOVERY simple
      4. DBCC SHRINKFILE (Database_Name_log , 1)

提交回复
热议问题