MS SQL 2005 and 2008 methods for shrinking logs

Source: Internet
Author: User

Step 1:

The SQL statement for 2005 is: Back up log database name with NO_LOG purpose: Truncate database log

The SQL statement for 2008 is: ALTER DATABASE name set recovery simple purpose: Set data to Easy mode

Step 2: Right-click on the specified database and select "task", "shrink", "file".

Step 3: re-open the tab to the right of the "file type" drop-down menu, select "Log", in the "Shrink action" option below, select "Reorganize page before freeing unused space", "Shrink file to", fill 0, click "OK" button.

Step 4:sql2008 After you shrink the log, you need to restore the simple mode to full mode

SQL statement: ALTER DATABASE data name set recovery full

Refer to the Friends of the park article:

Http://www.cnblogs.com/b3b4/archive/2010/03/25/1694595.html

Http://www.cnblogs.com/TLLi/archive/2012/07/15/2592042.html

MS SQL 2005 and 2008 methods for shrinking logs

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.