(go) Resolution of an LDF file in SQL Server is too large

Source: Internet
Author: User

in SQL Server, where the transaction log is often large, in addition to setting the database to auto shrink, you can use the following SQL command to quickly clear the transaction log in the database as follows:
-First step: Empty the log
  
DUMP TRANSACTION
DatabaseName
with
no_log
  
--Step two: Truncate the transaction log
  
BACKUP LOG
DatabaseName
with
no_log
  
--Step three: Shrinking the database
  
DBCC shrinkdatabase (databasename)


Some points need to be explained:
1. The above SQL commands need to be executed in sequence;
2. Executing the above commands is usually much faster than using the "shrink" command directly in the right-click menu

Resources:
SQL SERVER Database log is full, how to shrink the database log
Http://blog.csdn.net/faintbear/archive/2005/02/06/283316.aspx
How to shrink a database log
Http://www.cndiy8.com/data/web5701/20050228/20050228__3794589.html

  

(go) Resolution of an LDF file in SQL Server is too large

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.