Clear SQL Log files

Source: Internet
Author: User
Tags mssql system log management studio sql server management sql server management studio

1. Clear the errorlog file

MSSQL in the C:\Program Files\Microsoft SQL Server\mssql.1\mssql\log directory to store these log files, a total of 7, often because these log files continue to grow and lead to C disk no space

SQL2005 has 7 error, from Errorlog,errlog.1 to errorlog.6.
To clear the contents of these log files, you can execute the following statement in a new query:

EXEC Sp_cycle_errorlog

Each execution will produce a new errorlog, first remove the errorlog.6, and then delete, that is, FIFO (queue similar situation)

This can be performed 7 times in a row to refresh the errorlog all over again. The old ones have been erased.

Finally looked at the system log, found that these error logs are due to some inexplicable host constantly in even my server, audit unsuccessful generated.

In SQL Server 2008, for example, the database log for SQL Server mainly consists of the following aspects:

1. Open the SQL Server Management studio-> management->sql Server log: The corresponding log in this directory is the error log generated by the database during the run phase. If the database is installed into the D:\Program Files\Microsoft SQL Server\, the log here will be saved in the path: D:\Program Files\Microsoft SQL Server\mssql10. Xxmsql2008\mssql\log,errorlog is usually the current log, with a. x (number) that is typically a numbered log. There are also logs similar to those in the Fdlauncherrorlog, which are related to the database login. These logs belong to the entire database server instance.

2, corresponding to a specific database log files, such as a database: db_test (corresponding database files and log files are: Db_test.mdf and db_test_log.ldf), Db_test_ Log.ldf is the log file for the database that is supposed to be, and it records information about the operation of the database.

3, SQL Server Agent error log, these logs and 1 of the log will be saved in the same path under the log folder, its name is generally similar to sqlagent.out/x (number), the out suffix is the current log, followed by the number of numbered logs.

4, LOG_86.TRC, with TRC as the suffix of the tracking log, I am accustomed to use SQL Server Profiler tool to track information

Clear SQL Log files

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.