Automatic cleanup of Sqlservererrorlog error logs to avoid too much

Source: Internet
Author: User

Problem Description: Open SQL Server automatic backup, backup files more and more, there is no timely cleanup, resulting in insufficient server space, backup error, so that a few g of errorlog files, affecting the system login management.

Workaround: Periodically clean up SQL Server errorlog files.

Log file: SQL Server saves 7 errorlog files by default, named: errorlog errorlog.1 errorlog.2 errorlog.3 errorlog.4 errorlog.5 Errorlog.6

Cleanup method: As soon as we execute the sp_cycle_errorlog stored procedure, the errorlog.6 is deleted, the other log number is automatically added 1, and a new errorlog is created, that is, as long as 7 sp_cycle_errorlog is executed, will be able to delete all previously generated error logs.

Automatic cleanup: How do I process logs on a regular basis? The answer is to use SQL Server Agent, add the job, execute once a day sp_cycle_errorlog!

Automatic cleanup of Sqlservererrorlog error logs to avoid too much

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.