The transaction log for database ' xx ' is full,error:9002, severity:17, State:2

Source: Internet
Author: User

Check the database log, there is the following error message:

9002174.transactionlogforisspaceinthelogthein sys.databases

To view the usage of the current log:

Here the log is not completely full, but already occupy 70GB log file 79%, also has more than 50 GB, personally feel this is not normal. Individuals have read the SQL Server 2012 Implementation and Management Guide, which is described in this section of the log:

ServerServerServer都会保留(做过日志备份也没有用)。

so the existence of long transactions is the most questionable clue.
View the log_reuse_wait and LOG_REUSE_WAIT_DESC values for database ' sharedservices1_search_db ' in System View sys.databases:

Here you can see that the Log_reuse_wait_desc value is ' active_transaction '
This means that the log is waiting for transaction checkpoints. This is further proof that the long transaction resulted in the extra-large transaction log being caused by the extra-long firm.
For a description of the sys.databases view See (https://msdn.microsoft.com/zh-cn/library/ms178534.aspx+%20+%22%E5%AE%98%E6%96%B9%E8%AF% B4%E6%98%8E%22)

View long transactions:

currentdate2015-04-08 14:47:42.430

You can see that a long transaction is running and has been running for nearly 90 minutes.
View transaction Related information:

selectfromwhere is_user_transaction=1session_id  transaction_id  is_user_transaction is_local1566         3452140915             1              1

View transaction specific content according to session_id:

selectfromwhere session_id=1566textCREATEPROCEDURE dbo.proc_MSS_Crawl ..............................

You can also look at the current state of the transaction through TRANSACTION_ID:

SelectTransaction_begin_time, CaseTransaction_type when 1  Then ' read/write transaction '  when 2  Then ' read-only transaction '  when 3  Then ' System transaction '  when 4  Then ' Distributed transaction ' EndTran_type, CaseTransaction_state when 0  Then ' not been comoletely initaialiaed yet '  when 1  Then ' initaialiaed but ha notstarted '  when 2  Then ' Active '  when 3  Then ' ended (read-only transaction) '  when 4  Then ' commit initiated for distributed transaction '  when 5  Then ' transaction prepared and waiting resolution '  when 6  Then ' commited '  when 7  Then ' being rolled back '  when 0  Then ' been rolled back ' EndTransaction_state fromSys.dm_tran_active_transactionswhereTransaction_id=3452140915Transaction_begin_time Tran_type Transaction_state --Geneva- ,  -: -:52.040 Read/Write TransactionActive

When you have identified the statement, you can find the developer to see why.

The transaction log for database ' xx ' is full,error:9002, severity:17, State:2

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.