SQL Server Log File cleanup

Source: Internet
Author: User

When I restored the database from the database backup, I found that there were more than 120 GB of log files, but I couldn't use SQL Management. I used the DBCC statement to clear it! Space released! And speed!

First of all, we need to check the type of the backup data. This is very important, but it cannot be cleared.

Select name, recovery_model_desc from sys. databases

After the command is executed, you can see the recovery_model_desc category. For the FULL type, you must first change it to the SIMPLE type.

Alter database name set Recovery simple

Start release

Dbcc shrinkfile (n' Database Log File name', 10)

Query after successful release

Select name, size FROM sys. database_files

Change to FULL type

Alter database DNNZhongChangOA SET Recovery FULL

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.