SQL Server log file too large log file cleanup method does not detach the database

Source: Internet
Author: User
Tags sql 2008

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.