SQL Server log file too large log file cleanup method, the network provides a lot of separate database--〉 delete log files-〉 Additional database method, this method is too risky, the process is relatively long, and sometimes there will be the phenomenon of separation unsuccessful. The following methods do not require database separation and additional operations.
SQL 2008 Shrink Empty Log method:
1. In the SQL2008 to clear the log must be in the simple mode, and so on after the purge action to return to the full mode, must be changed back to full mode, or the database does not support point-in-time backup.
1). Select Database – Properties-Options-Recovery mode – choose Simple.
2). After shrinking the database, recall the complete.
2. Can be directly operated by command
Use[Master] GO ALTER DATABASEThe name of the database to clean upSETRECOVERY Simple withno_waitGO ALTER DATABASEThe name of the database to clean upSETRECOVERY Simple--Simple ModeGO Usethe name of the database to clean upGO DBCCShrinkfile (N'the name of the database to clean up _log',2, truncateonly)--after setting the compressed log size to 2M, you can specify your ownGO Use[Master] GO ALTER DATABASEThe name of the database to clean upSETRECOVERY Full withno_waitGO ALTER DATABASEThe name of the database to clean upSETRECOVERY Full --revert to Full modeGO
Original website: 54575592
SQL Server log file too large log file cleanup method does not detach the database