Why the transaction log is full in SQL Server and the workaround

Source: Internet
Author: User

Error description: The transaction log for the database is full. To find out why the space in the log cannot be reused, see the Log_reuse_wait_desc column in sys.databases.

First introduce the concept of transaction log (from Baidu Encyclopedia):

The transaction log is a file that is separate from the database file. It stores all changes made to the database and records all INSERT, UPDATE, delete, commit, fallback, and database schema changes. The transaction log is also known as a roll forward or redo log.

The transaction log is an important component of backup and recovery and is required to replicate data using SQL Remote or [replication agent].

By default, all databases use the transaction log. The use of the transaction log is optional, but you should always use it unless you are not using it for a special reason. Running a database with transaction logs provides stronger failsafe capabilities, better performance, and data replication capabilities.

The cause of the exception is thrown:

A. Uncommitted transactions

B. Very large business

C. Operations: DBCC Dbreindex and CREATE INDEX

D. When restoring from a transaction log backup

E. Client applications do not process all results

F. Query timed out before the transaction log completion extension, you receive a fake "Log full" error message

G. Non-replicated transactions

Workaround:

1. Free up disk space (for beginners);

2. Move the database to a fully-memory disk (same principle);

3. Emptying the log: DUMP TRANSACTION library name with no_log;

4. Truncate the transaction log: BACKUP log library name with no_log;

Why the transaction log is full in SQL Server and the workaround

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.