Compressing SQL Server Log Files

Source: Internet
Author: User

1. Clear logs
Dump transaction dbname with no_log

2. truncate transaction logs:
Backup log dbname with no_log

3. Shrink database files
Enterprise Manager-> right-click the database you want to compress-> all tasks-> shrink database-> shrink File
-- Select Log File> select shrink to xxm In the shrink mode. Here, a minimum number of MB allowed to be shrunk is displayed. Enter this number directly and click OK.
-- Select data file-select to shrink to xxm in the contraction mode. Here, a minimum number of MB allowed to be shrunk is displayed. Enter this number directly and click OK.

4. In order to automatically contract in the future, make the following settings:
Enterprise Manager-> server-> right-click Database-> properties-> options-> select "auto contract"

5. If you want to prevent the log from increasing too much in the future
Enterprise Manager-> server-> right-click Database-> properties-> transaction log
-> Limit file growth to xm (X is the maximum data file size you allow)

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.